Skip to content

rustdoc table of content #80858

@Zenthae

Description

@Zenthae

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

jyn514 commented on Jan 10, 2021

@jyn514
Member

Duplicate of #40273 and #14475.

mightyiam

mightyiam commented on May 17, 2022

@mightyiam
Contributor

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

Zenthae commented on May 17, 2022

@Zenthae
Author

more like the table of content of this readme

https://github.com/jonschlinkert/markdown-toc

mightyiam

mightyiam commented on May 18, 2022

@mightyiam
Contributor

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

mightyiam commented on Aug 25, 2023

@mightyiam
Contributor

@jyn514 could you perhaps consider that this is a a different feature "request"?

added a commit that references this issue on Sep 5, 2024
f0de876
added a commit that references this issue on Sep 5, 2024
e1da72c
added a commit that references this issue on Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mightyiam@jyn514@Zenthae

        Issue actions

          rustdoc table of content · Issue #80858 · rust-lang/rust