-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
[rustdoc] Sort items alphabetically in the sidebar #57448
Comments
Items that are related may be grouped in the source, sorting would remove that association. E.g. you can find |
Items on module pages are already sorted - the If we start sorting things on other pages - methods, fields, variants, etc - it needs to be more intelligent than "alphabetically". For example, there have been requests in the past for sorting "static methods" (that don't take |
One thing i would like to see is grouping things that aren't methods (e.g. associated consts, i don't know if there's anything else you can associate to a type right now) separately from methods. We already break out associated types for traits, it seems right to break out associated consts from the "Methods" section. |
Re-sorting alphabetically something that is often carefully sorted by the author already (in source) seems… wrong. At the very least there is a good reason why constructing methods appear first in the source, then many of the deconstructing methods, then Adding extra heuristics will help with some of the groupings and orderings but not the others. |
That's a lot of things I didn't think about. Also, if there is already a flag to disable it, then it's all fine. |
@GuillaumeGomez @QuietMisdreavus sorry I couldn't participate on this last night, but I have something to add: keeping the declaration order is nice, but what I would really like is that the index on the left of the page be sorted. |
@Geal On this point I agree. I reopen the issue with this purpose. |
It would be nice to at least order trait implementations alphabetically, the current order doesn't even seem to relate in any way with the order of the things in source code. |
…ebar, r=QuietMisdreavus Sort elements in the sidebar Fixes rust-lang#57448. Not sorting fields or variants though. r? @QuietMisdreavus
Currently, the items on the rustdoc pages are sorted in the order of apparition in the source code. I think it'd be nicer to have them sorted alphabetically.
cc @rust-lang/docs @rust-lang/rustdoc @Geal
The text was updated successfully, but these errors were encountered: