-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Description
i know that it was already discussed before but i believe that it as more weight now since the language got quite a bit improved since then, lot of crate now have extensive documentation and it's quite tedious to read through them, so i think making rustdoc automatically generate a table of content on each page is a need (maybe having an inline comment to disable it on some page could be a good idea (for small pages)).
For the where to put it, i still have a lot of space available on the right side of the pages, (at least on my screen resolution) and for smaller screen it can be put at the beginning, as for what to use as title, i think just using the already parsed markdown headers with just a bit of indentation depending of the weight and it should be enough.
Activity
jyn514 commentedon Jan 10, 2021
Duplicate of #40273 and #14475.
mightyiam commentedon May 17, 2022
I'm not sure that #40273 and #14475 cover what the OP intended. To me it feels like @Zenthae meant for a feature that is similar to what GitHub does for markdown sections. Is that right, @Zenthae ?
Zenthae commentedon May 17, 2022
more like the table of content of this readme
https://github.com/jonschlinkert/markdown-toc
mightyiam commentedon May 18, 2022
Well, that's just a different implementation. The point is this: this is a table of contents generated from the headings of a page.
It's not about the public items such as modules, functions and traits.
And I'd like this as well.
@jyn514 ?
mightyiam commentedon Feb 18, 2023
Here's what I have to do to implement this in my crate:
https://github.com/mobusoperandi/michie/blob/f2167bc6a0f835e2056dc7c47601db542123c737/Makefile.toml#L59-L66
And here's how I enforce that it is up-to-date:
https://github.com/mobusoperandi/michie/blob/f2167bc6a0f835e2056dc7c47601db542123c737/Makefile.toml#L14-L18
https://github.com/mobusoperandi/michie/blob/f2167bc6a0f835e2056dc7c47601db542123c737/Makefile.toml#L68-L76
mightyiam commentedon Aug 25, 2023
@jyn514 could you perhaps consider that this is a a different feature "request"?
Rollup merge of rust-lang#120736 - notriddle:notriddle/toc, r=t-rustdoc
Rollup merge of rust-lang#120736 - notriddle:notriddle/toc, r=t-rustdoc
Unrolled build for rust-lang#120736
Rollup merge of #120736 - notriddle:notriddle/toc, r=t-rustdoc