Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
ocamldoc does not generate HTML linkable IDs for modules #7635
Original bug ID: 7635
ocamldoc does not generate span elements with linkable IDs when generating HTML documentation.
Steps to reproduce
If I have the following mli:
module A : sig end
val a1 : a
And I run ocamldoc on it to produce HTML documentation, the HTML will contain linkable IDs (in span elements) for the latter two items, but not the first one, that is not for the module:
Comment author: @Octachron
It is true that submodule items are not given a specific id. However, submodules are fully expanded in a separate page ("Main.Submodule.html"), thus it is still possible to link to a specific submodule.
Do you have any example where it would make sense to link to "Main.html#MODULEA" rather than "Main.A.html"?
Comment author: @yawaramin
My goal is to allow generating a table of contents for each module doc page. E.g., for the module sig above, I would want to generate the following TOC:
(Using parens instead of angle brackets here because otherwise Mantis is trying to format as HTML. I would also include after the closing tag the first sentence of the item's doc comment, for ease of reference.)
To make this possible, it would be good to have that 'MODULEA' ID, e.g. Otherwise if the user clicked on types and values in the TOC they would be jumped down to the main documentation for the item, in the same page; but if they clicked on a module they would be jumped to another page, which would be confusing.