rustdoc: add a list of headings to the sidebar#41280
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
src/librustdoc/clean/mod.rs
Outdated
There was a problem hiding this comment.
I was so confused why enums weren't getting the sidebar stuff, until I decided to trace back through what is_enum was doing. Apparently it's been like this for a while, but there's also no other users for this method, so it's not harming anything.
There was a problem hiding this comment.
But now it's working correctly, which is great.
|
👍 |
|
Oh and please clean your git history. |
|
Can do. I'll squash when this is ready to roll, in case there's some aesthetic commentary. |
|
Well, please put a whitespace after |
|
Huh, the earlier commit failed Travis because the link-checker failed me for broken TOC links. Good job, link-checker! |
|
Hm is this waiting on a squash by @QuietMisdreavus or a review from @steveklabnik? |
|
Probably mainly on me, but I was wanting to see if there were any remarks on the "open questions" I had on the bottom of the lead comment. If @steveklabnik and @GuillaumeGomez are fine with this as-is, though, I'll squash and carry on. |
|
Good for me. |
|
Let's do it! |
6fd01ec to
27bfbd5
Compare
|
@bors: r+ |
|
📌 Commit 27bfbd5 has been approved by |
…laumeGomez rustdoc: add a list of headings to the sidebar It's another misdreavus rustdoc PR, which means it's time for Bikeshed City once again! `:3` In an effort to aid navigation in long documentation pages, this PR adds a listing of headings to the sidebars of pages where such headings exist. For example, for structs, links to their fields, inherent methods, and trait implementations are available where applicable. Examples: * Modules/Crate roots  * Enums  * Primitives  * Traits  * Structs  Open questions: * Right now, these kinds of pages (and also unions) are the only pages that will receive the name header - pages for functions, constants, macros, etc, won't have the corresponding name in their sidebar. Should I print the name regardless and only add table-of-contents links for pages that have them? This would make them match, for example, a struct with no public fields, no methods, and no trait implementations. The latter would still have a "Struct MyStruct" line above the module contents, with no header links to speak of, whereas a function wouldn't even have "Function my\_function". * This is only a header listing, but there has been requests to include a more-complete listing of fields/methods/traits/etc, for example in rust-lang#41123.
It's another misdreavus rustdoc PR, which means it's time for Bikeshed City once again!
:3In an effort to aid navigation in long documentation pages, this PR adds a listing of headings to the sidebars of pages where such headings exist. For example, for structs, links to their fields, inherent methods, and trait implementations are available where applicable.
Examples:
Open questions: