rustdoc
rustdoc copied to clipboard
Top Level Collapsible Tree View of a Crate (and standard library)
I would really like for a better table of contents to exist in rustdoc. A collapsible tree-view navigation, where
- non-leaf nodes are modules
- leaf nodes are either a struct, trait, or macro.
I see there being a few stories around navigating stdlib/crate docs and api references:
- I am searching for docs on a specific type I already know. (use search feature)
- I am not sure what the exact type I am looking for is, but I have a general idea. ex: I need a re-sizable, searchable data structure. (current navigation works for this).
- I want a top level view to understand the structure of this crate. Maybe to evaluate it. Maybe to build my intuition on it. (this is the story I think this suggestion helps most for).
Are there any comparable things that exist now that I could check out?
Maybe something like scribble which is Racket's documentation tool?
@steveklabnik Sorry, didn't have a real world example in mind when I made the suggestion. A little googling and I found this which is more or less what I was envisioning.
Not sure if it would make for a better experience to have it start collapsed or not, but I definitely think it could use a collapse/expand all button similar to what rustdoc currently provides for collapsing/expanding the methods that exist for a type.
Given the fact we already have a sidebar with modules and types in it on current Rustdoc I see no reason we couldn't flesh it out a bit on the left to be a bit more tree like.
@mgattozzi Good idea and it makes sense to me.
Updating the top post to include some user stories.