Open Nemo157 opened 4 years ago
An idea for supporting all dependencies, we could run a first cargo check --message-format=json
and extract all the .rmeta
filenames for all crates built, then pass flags using those as the key instead
--extern-html-root-url libasync_compression-ad6b882a4c15a1f0.rmeta=https://docs.rs/async-compression/0.2.0
--extern-html-root-url libasync_compression-875810b2ce8d0002.rmeta=https://docs.rs/async-compression/0.3.5
This is basically the same as https://github.com/rust-lang/rust/issues/56169, but I'll leave it open to make sure that someone remembers to update extern-html-root-url
whenever the other issue gets fixed.
Got a failing testcase at least: https://github.com/rust-lang/rust/compare/master...Nemo157:issue-76296.
I don't think this is really related to #56169 since this issue should be fixable without fixing that. If you have multiple crates with the same crate name, but different internally specified html-root-url
it already works correctly. It's only the ability to override the html-root-url
for a specific instance of the crate that is missing.
With this package that uses dependency renaming:
I tried to build documentation that can link to both of the upstream docs.rs documentation pages:
This failed to link to either of the non-inlined exports because it seems that
--extern-html-root-url
expects the library name instead, changing to use that:This successfully added links on both, but both directing to version
0.3.5
since that was the last flag specified.(I'm not sure of the correct solution for this, currently docs.rs only passes
--extern-html-root-url
for direct dependencies, so changing to use the same name as used for--extern
would work for that; but it seems to me that docs.rs should be passing a flag for all dependencies, since it's possible for documentation from a dependency of a dependency to bubble-up and be rendered, so it should be possible to set the html-root-url for them all, I'm not sure how we would identify the crates in that case).Meta