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 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!