Rust doc `--extern-html-root-url` should support relative paths.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Hi!
I am using a bazel project and therefore am invoking rustdoc directly instead of through cargo rustdoc. Rustdoc has a --extern-html-root-url flag which allows you to specify external paths for crates.
Project setup:
I have a workspace of 2 crates:
- a
- b
a has public dependency of b and has functions which reference b's types in the public api.
If I invoke rustdoc by first building a's docs and then b the links for b in a's docs do not resolve, I am using the --extern-html-root-url flag to inform rustdoc to generate links for b relative to the output of a like this --extern-html-root-url b=/.
Ideally, if the path is relative rustdoc should make it relative to the output folder.
In a hierarchy where
/aisa's docs/bisb's docs/is an index (maybe generated via--enable-index-page
Then if I add the flag --extern-html-root-url b=/ it should map to / relative to the index page.
Currently this is ignored.
in crate bang
references crate type_defs
build order: [bang, type_defs]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the two-crate rustdoc build described in the issue, using --extern-html-root-url b=/ and checking the generated links. Trace rustdoc's handling of that flag and make relative paths resolve from the documentation output location; done means links from crate a to crate b resolve in the described hierarchy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100