-
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
Provide a way to interpolate crate version in html_root_url #42300
Comments
Macros in attributes would neatly solve this, just sayin'. |
I recently implemented Hopefully docs.rs will set |
If I'm reading this commit correctly, it appears that docs.rs does it now. This is not documented anywhere though, as far as I can see. |
Apparently that's not enough to not need |
I may not have a good understanding of the issue but I think what we would like is the ability to write (something like):
Where {version} refers to the value in Cargo.toml (which is available in macros c.f. the clap crate), so it might need to be (say) {Cargo.toml::version} to indicate the source without the compiler needing to just "know" it and thus Cargo.toml being somewhat "magical" (this assumes we may want/need other possible distinguishable sources). Of course #![doc("link")] is an attribute not a macro so this method maybe more easily suggested than coded. Once this substation mechanism is added it may well find a lot of uses elsewhere. Or I maybe talking tosh :(. |
In Serde we work around this by having a reminder in Cargo.toml to update the html_root_url when releasing a new version. serde-rs/serde@dc7ab26
#![doc(html_root_url = "https://docs.rs/serde/1.0.8")]
This is annoying and easily falls out of sync. For example mio 0.6.8 docs point to version 0.6.1: tokio-rs/mio#613.
There should be a way to keep these synchronized automatically.
The text was updated successfully, but these errors were encountered: