-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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: add unstable option --crate-list-heading
to customize the sidebar crate list.
#138143
base: master
Are you sure you want to change the base?
Conversation
r? @notriddle rustbot has assigned @notriddle. Use |
Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @jsha |
--crate-list-heading
to customize the sidebar crate list.--crate-list-heading
to customize the sidebar crate list.
This comment has been minimized.
This comment has been minimized.
90486a8
to
61edefc
Compare
When used, this option creates a subheading within the sidebar “Crates” list for this crate and all crates which pass the same value. These headings are displayed in alphabetical order; crates without the option, or with it set to the empty string, always appear first. The intended use of this option is to allow Cargo to automatically separate a workspace’s crate list into the workspace’s own crates and their external dependencies. Authors could also use RUSTDOCFLAGS or other means to create custom headings for their documentation builds.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I'm fine with this direction. There are a few nits, but mostly I'm fine with it.
It's nice that Cargo can use this API, so it'll know about things like workspaces, but it's flexible enough that other projects like Linux can use it for their own purposes.
Some changes occurred in src/tools/cargo cc @ehuss Some changes occurred in GUI tests. |
Ignore that Cargo ping; I accidentally pushed a submodule change (not sure what was going on; I had only uncommitted changes, but it seemed like one of the tests changed the submodule commit too). |
The job Click to see the possible cause of the failure (guessed by this bot)
|
I do not understand the
|
Do you have an example hosted somewhere by any chance so I can take a look? |
☔ The latest upstream changes (presumably #138416) made this pull request unmergeable. Please resolve the merge conflicts. |
When used, this option creates a subheading within the sidebar “Crates” list for this crate and all crates which pass the same value. These headings are displayed in alphabetical order; crates without the option, or with it set to the empty string, always appear first.
The intended use of this option is to allow Cargo to automatically separate a workspace’s crate list into the workspace’s own crates and their external dependencies (as requested in #85759 and, loosely, #81031). Even without Cargo support, authors could also use
RUSTDOCFLAGS
to create custom headings for their documentation builds (which may address #16328).As currently written, merging this would break all nightly builds against a pre-existing
target/doc/
, because the format ofcrates.js
(defining variablewindow.ALL_CRATES
) is changed. I don’t know whether backwards compatibility is worth implementing here, but it is possible to arrange — I figured I should first get a review of the general idea before polishing it.Example of the new sidebar appearance in one of my workspaces:
Original obsolete version
The vertical margins
<h3>Dependencies</h3>
should probably adjusted to have clearer visual hierarchy, but I don’t think that should be done in this PR. Also note that this additional header will not appear until explicitly requested via the flag — in this screenshot I am also using a patched Cargo.@rustbot label A-rustdoc-ui T-rustdoc T-rustdoc-frontend