Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ordering of items in left hand navbar is different from main page #91120

Closed
aDotInTheVoid opened this issue Nov 22, 2021 · 4 comments
Closed
Labels
A-rustdoc-ui Area: rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@aDotInTheVoid
Copy link
Member

On https://doc.rust-lang.org/1.56.1/std/error/trait.Error.html#provided-methods

image

Here one is in alphabetical order, the other is in source order.

(This also happens on nightly, but I'm giving a stable link so it doesnt change

This also happens for other headings (eg Implementations)

@rustbot modify labels: +A-rustdoc-ui +T-rustdoc

@rustbot rustbot added A-rustdoc-ui Area: rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 22, 2021
@aDotInTheVoid
Copy link
Member Author

Prehaps the solution to this and #91118 is to build the left bar at the same time as the main page, instead of seperatly.

I think this would make things much cleaner

@jyn514
Copy link
Member

jyn514 commented Nov 22, 2021

This is intentional, to make the sidebar more like a table of contents.

I think any changes in this area need either an FCP or RFC, I'm very uncomfortable just changing it because some people find it surprising. Everything here has a ton of tradeoffs and makes some people more unhappy.

@aDotInTheVoid
Copy link
Member Author

Fair enough, although a toc is in the same order as content, but it works well as and index instead

@jsha
Copy link
Contributor

jsha commented Nov 22, 2021

@aDotInTheVoid FWIW, I agree with you - it would be conceptually cleaner for the sidebar to act more like a TOC by being in the same order as the content. But that would mean either the sidebar would have to be non-alphabetical (hard to search for items), or the content would also have to be alphabetical. But having the content in order by appearance in the source is useful so crate authors can group related methods together, and put the most important methods (like constructors) at the top of the documentation, for people to read it in order.

I'd love to find a way to make the sidebar act more TOC-like while still preserving those use cases, but haven't thought of a good way so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants