-
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
Add an option to allow rustdoc to list modules by appearance #46787
Conversation
The `--sort-modules-by-appearance` option will list modules in the order that they appear in the source, rather than sorting them alphabetically (as is the default). This resolves rust-lang#8552.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @QuietMisdreavus (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thanks for the PR! This looks pretty good, but there's a couple things i want to poke at: First, the tidy check failed because the
(If you want to test this yourself before uploading any new commits, you can run Next, i'd like to see a test for this. How well do you know XPath? I think the ordering could be possible to express in the XPath that the rustdoc tests use, and i know that adding the flag for rustdoc is possible. The tests for rustdoc output currently live in |
I couldn't quite work out how to use XPath effectively here, but at least for the current page generation, simply using a regex worked sufficiently. I've added the test — thanks, I should have considered adding one earlier! |
Nice! This looks great now. Thanks for making the flag an unstable one - that'll help if we need to mess with it later. If travis checks out, i'll go ahead and r+ it! |
@bors r+ |
📌 Commit b3c6102 has been approved by |
Add an option to allow rustdoc to list modules by appearance The `--sort-modules-by-appearance` option will list modules in the order that they appear in the source, rather than sorting them alphabetically (as is the default). This resolves rust-lang#8552.
The
--sort-modules-by-appearance
option will list modules in theorder that they appear in the source, rather than sorting them
alphabetically (as is the default). This resolves #8552.