Effacer les filtres
Effacer les filtres

Links in HTML Documentation generated by MATLAB not linking to correct location

4 vues (au cours des 30 derniers jours)
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.

Réponse acceptée

Kshittiz
Kshittiz le 24 Juil 2023
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

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Tags

Produits


Version

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by