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.
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: