-
Notifications
You must be signed in to change notification settings - Fork 128
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
Usage of #![doc(html_root_url)] #185
Comments
So that cross crate linking in documentation works. |
How does that work? Can you give an example of where the env_logger docs contain a cross-crate link, or some general docs about |
Not sure, I never used it. But it's listed under the API guidelines for Rust: https://rust-lang.github.io/api-guidelines/documentation.html#crate-sets-html_root_url-attribute-c-html-root I only found this issue: rust-lang/api-guidelines#186 |
Okay, so basically a workaround for a docs.rs issue? And even one that we are very unlikely to hit with a lib that's not really meant to be part of other crates' public APIs? @jyn514 can you confirm? |
To be honest, I don't see any reason to remove it. Who knows who might actually rely on this. Like, some internal documentation for projects might link back to this or so. It's not a workaround, I think it's the way it's supposed to work. The issue is about having documentation on the style guidelines regarding it in general. |
The reason I'd like to get rid of it is that with it, a release takes longer (even if just a few seconds) and is easier to screw up.
This makes no sense to me. There is no information that attribute adds that a tool like docs.rs couldn't theoretically infer. |
I don't like that suggestion on the API guidelines. From the rustdoc documentation:
This information has nothing to do with building documentation on docs.rs. This is for when you build locally with |
My bad then. |
To clarify, the scenario where this goes wrong is:
Then the links to env_logger will be broken. But there's a simple fix and the fix is to remove |
Thanks for the clarification!
Do you think it would be worthwhile to try changing this part of the API guidelines? Either way, I'll remove the attribute from env_logger. |
That's not really relevant to html_root_url, it's about hand-written links, not the links rustdoc generates automatically.
Sure, I'll look into it. |
I know, should have written it more explicit. I didn't find anything when googling. |
@KodrAus @sirwindfield is one of you aware why we have
#![doc(html_root_url = "https://docs.rs/env_logger/0.8.1")]
at the crate root? I find it a bit annoying to have to bump that when releasing a new version.The text was updated successfully, but these errors were encountered: