From db113f5319bd98165a7d3a7e67e8d71dfe029c72 Mon Sep 17 00:00:00 2001 From: QuietMisdreavus Date: Tue, 5 Jun 2018 20:17:06 -0500 Subject: rustdoc: add --extern-html-root-url flag --- src/doc/rustdoc/src/unstable-features.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/doc/rustdoc') diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index 7f110d6a3d2..ff00299aeba 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -361,6 +361,21 @@ This flag allows rustdoc to treat your rust code as the given edition. It will c the given edition as well. As with `rustc`, the default edition that `rustdoc` will use is `2015` (the first edition). +### `--extern-html-root-url`: control how rustdoc links to non-local crates + +Using this flag looks like this: + +```bash +$ rustdoc src/lib.rs -Z unstable-options --extern-html-root-url some-crate=https://example.com/some-crate/1.0.1 +``` + +Ordinarily, when rustdoc wants to link to a type from a different crate, it looks in two places: +docs that already exist in the output directory, or the `#![doc(doc_html_root)]` set in the other +crate. However, if you want to link to docs that exist in neither of those places, you can use these +flags to control that behavior. When the `--extern-html-root-url` flag is given with a name matching +one of your dependencies, rustdoc use that URL for those docs. Keep in mind that if those docs exist +in the output directory, those local docs will still override this flag. + ### `-Z force-unstable-if-unmarked` Using this flag looks like this: -- cgit 1.4.1-3-g733a5