-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
rustdoc: provide a way to override html_root_url #19603
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-dev-tools
Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Comments
A simple solution would be to recognize those attributes on |
That would be hard to use with |
Triage: I am not aware of any changes in this area. |
This was referenced Aug 12, 2016
bors
added a commit
that referenced
this issue
Aug 31, 2018
rustdoc: add flag to control the html_root_url of dependencies The `--extern-html-root-url` flag in this PR allows one to override links to crates whose docs are not already available locally in the doc bundle. Docs.rs currently uses a version of this to make sure links to other crates go into that crate's docs.rs page. See the included test for intended use, but the idea is as follows: Calling rustdoc with `--extern-html-root-url crate=https://some-url.com` will cause rustdoc to override links that point to that crate to instead be replaced with a link rooted at `https://some-url.com/`. (e.g. for docs.rs this would be `https://docs.rs/crate/0.1.0` or the like.) Cheekily, rustup could use these options to redirect links to std/core/etc to instead point to locally-downloaded docs, if it so desired. Fixes #19603
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-dev-tools
Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Rustdoc generates external links for standard library items. For example,
Result
at http://servo.github.io/rust-url/url/type.ParseResult.html links to http://doc.rust-lang.org/nightly/core/result/enum.Result.htmlThis URL seems to be determined from the
#[doc(html_root_url = "…")]
attribute in the crate that defines the item. There is apparently no way to override it.Servo uses a Rust version that is often behind nightly, so I’d like http://doc.servo.org/ to link to docs for the Rust version that’s actually being used. Currently, this is achieved by copying Rust docs from the snapshot to the same location as where Servo docs are being generated. As a result, the crate index side bar lists both Servo and Rust crates, and is hard to read since there are so many of them.
I’d like instead to have docs for our Rust version at a different location, maybe http://doc.servo.org/rust-snapshot/ , and have standard library items link to that. The latter requires rustdoc accepting an override to
html_root_url
of external crates.The text was updated successfully, but these errors were encountered: