-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
let rustdoc print the crate version into docs #44989
Conversation
Some changes occurred in HTML/CSS. |
(rust_highfive has picked a reviewer for you, use r? to override) |
Pings for everyone! @rust-lang/docs Does this look right? Is this a good place for this? Right now it only shows up on the root module's page - nothing else will show this. Should we put it everywhere? @GuillaumeGomez and @steveklabnik specifically (possibly dev-tools more broadly, but for now i'll stick with rustdoc peers) - This is a new command-line flag. In dev-tools meeting today the prevailing air was that this was not RFC worthy since it was straightforward enough, but i want to make extra sure that the other rustdoc stakeholders are on board. @alexcrichton @Mark-Simulacrum (other rustbuild experts?) - How can I get bootstrap to use this flag when rendering docs for std and friends? |
Seems to be good. What happens with a very long version name? Does it goes on two lines or does it just stick out of the sidebar? |
This is a (smaaall) bug then. :p |
This sounds good to me! |
Use these styles to fix the wrapping issue on most modern browsers. overflow-wrap: break-word;
word-wrap: break-word; /* deprecated */
word-break: break-word; /* Chrome, non-standard */ |
8cdaec5
to
fcee950
Compare
Now it's all good. Thanks! @bors: r+ rollup |
📋 Looks like this PR is still in progress, ignoring approval |
Ah damn, well, r=me once done. |
Yeah, the rustdoc piece is basically done, but i'd like to see if i can get rustbuild to use this when generating the docs for std and friends before calling it done. I'll ask around again. |
You'll need to edit Let me know if you'd like more detailed instructions, or I can probably get you a commit implementing this within a few days. |
@Mark-Simulacrum That got me most of the way there. It turns out that the docs weren't using If you think this is fine, then i'm ready to call this good. |
b0b746c
to
ce71c9e
Compare
Hm, I'm suspecting that |
21cb80a
to
5a847c6
Compare
Ooh, i like that option. I've force-pushed with an update that uses that instead. |
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.
I'm happy with the rustbuild changes after this small nit.
@@ -574,6 +574,9 @@ impl<'a> Builder<'a> { | |||
cargo.env("RUSTC_SAVE_ANALYSIS", "api".to_string()); | |||
} | |||
|
|||
// For `cargo doc` invocations, make rustdoc print the Rust version into the docs | |||
cargo.env("RUSTDOC_CRATE_VERSION", self.build.rust_version()); |
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.
Let's also add this to rustdoc_cmd
above to make certain it's passed in all cases.
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.
Force-pushed with this update.
5a847c6
to
7ea286e
Compare
@bors r=GuillaumeGomez |
📌 Commit 7ea286e has been approved by |
… r=GuillaumeGomez let rustdoc print the crate version into docs This PR adds a new unstable flag to rustdoc, `--crate-version`, which when present will add a new entry to the sidebar of the root module, printing the given version number: ![Screenshot of a test crate, showing "Version 1.3.37" under the crate name](https://user-images.githubusercontent.com/5217170/31104096-805e3f4c-a7a0-11e7-96fc-368b6fe063d6.png) Closes rust-lang#24336 (The WIP status is because i don't want to merge this until i can get the std docs to use it, which i need help from rustbuild people to make sure i get right.)
This PR adds a new unstable flag to rustdoc,
--crate-version
, which when present will add a new entry to the sidebar of the root module, printing the given version number:Closes #24336
(The WIP status is because i don't want to merge this until i can get the std docs to use it, which i need help from rustbuild people to make sure i get right.)