Add a toc to each std lib generated pages · Issue #28056 · rust-lang/rust (original) (raw)

Long pages such as in regex have many examples but it's difficult to know at a glance what the documentation contains without scanning the entire document. Having a table of contents would help a lot with this.

Here is a list of links to different TOC styles from various places for ways it could be done:

I looked for some more but didn't find other good examples.

Of these, I like the mozilla, python 2, and gitbook TOCs best with the mozilla probably the best among them (probably because it's small and clean). However, I think the gitbook style is probably the most appropriate fit to the std libs style.

I've also provided a mockups of what a TOC could look like in that style which is similar to a different thread. Clearly, something would need to be done with the current sidebar to use this format.

Mockup:

toc