Links in HTML Documentation generated by MATLAB not linking to correct location
조회 수: 5 (최근 30일)
이전 댓글 표시
I used live MATLAB scripts to create documentation for some code. I used hyperlinks within the documentation to jump to different parts of the documentation. These links worked when I tested them in the live script.
However, when I exported the live scripts as HTML to use as documentation for a custom toolbox, I noticed the links didn't work anymore. When I clicked on them, they would jump to the table of contents at the top of the documentation rather than the section that I linked to within the document.
Does anyone know how to create these links so that they jump to the section I linked to in the documentation rather than the table of contents when I export to HTML?
Thank you.
댓글 수: 0
채택된 답변
Kshittiz
2023년 7월 24일
Hey,
Please note that the HTML generated by MATLAB doesn't inherently support internal anchor links, this is why you are being redirected to the table of contents instead of the linked sections.
To create links that correctly jump to specific sections within the exported HTML documentation, you can use HTML anchor tags and IDs, i.e. :
i) In the live script, add an HTML anchor tag with a unique ID to the section you want to link to.
ii) Create a hyperlink to the section using the href attribute and the ID of the anchor tag.
I hope this helps.
Thanks
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!