-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Rustdocs directly link to doc.rust-lang.org, breaking offline docs #97918
Comments
I have considered adding a post-processing step in the docs building that makes the links relative, but that can be difficult. There may be some cases where it really wants to intentionally link to the live site. It would also need to be smart about the channel link (like https://doc.rust-lang.org/nightly/… vs https://doc.rust-lang.org/stable/… vs https://doc.rust-lang.org/1.60/… etc.). I'm not sure how to handle those. It could leave any channel-specific links alone, and convert everything else rooted at https://doc.rust-lang.org/. However, I think there was an issue where rustdoc would create links to https://doc.rust-lang.org/nightly/… quite frequently, I'm not sure if that has been mostly solved. |
If it's not "rustdoc generated resources", it makes sense to link to the website in my opinion as we cannot be sure that the resource actually exists locally. However, a lot of doc links use |
I opened #97940. It seems like there is only one link in the public API that was not relative. There is another one in |
…an-DPC Use relative links instead of linking to doc.rust-lang.org when possible Part of rust-lang#97918.
…an-DPC Use relative links instead of linking to doc.rust-lang.org when possible Part of rust-lang#97918.
Use relative links instead of linking to doc.rust-lang.org when possible Part of rust-lang/rust#97918.
Closing this issue as the above linked pr and the issue seems to be fixed |
The docs for the standard library often link to other rust documentation items, like the reference or "Rust by Example". However, most/many of these links link to the versions hosted at doc.rust-lang.org. This causes problems when browsing a version of the docs hosted somewhere else, for instance the offline version installed via rustup. In that case, the linked version is also hardcoded and might not even match the one of the offline docs.
Example (
core::arch::asm
)Some pages will link to the docs on the same host, like the one for the keyword
pub
.There are currently about 1044 matches for
doc.rust-lang.org
in.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/html
:The text was updated successfully, but these errors were encountered: