-
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
Show library version in documentation generated by rustdoc #24336
Comments
There will need to be some coordination with cargo because "crate versions" are not something even rustc knows about. |
The |
cargo issue: rust-lang/cargo/issues/1681 |
Triage: no change. docs.rs kinda does this. |
From the info in rust-lang/cargo#1681 (comment), a "quick" patch for this would involve checking The major drawback to this would be that it codifies it around Cargo, rather than making it some kind of neutral setup that could easily be pulled out into other build systems. It's still just a couple environment variables, but they also have "Cargo" in the name. |
@QuietMisdreavus: Your logic seems ok. I just don't find this very useful but why not... |
We talked about this in today's dev-tools meeting, and we figured that adding new command-line flags for this won't require an RFC. I'd like to make a first-pass PR that adds them as unstable flags so we can hash out the particulars within that thread. |
That PR is live at #44989. |
… 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.)
I recently was using a library whose online documentation was out of date. One of the method signatures had changed and that wasn't reflected in the documentation. I checked the source code of the project to confirm that the signature had changed, but it also would have been nice to see on the documentation page that the version I was using didn't match up to the documentation version.
The text was updated successfully, but these errors were encountered: