Skip to content

rustdoc: provide a way to override html_root_url #19603

Closed
@SimonSapin

Description

@SimonSapin

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions