about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2019-05-16 12:31:44 -0700
committerGitHub <noreply@github.com>2019-05-16 12:31:44 -0700
commit2ae06976e47f06bcf0b9d50fe2603add1204bf26 (patch)
tree1a08feab6ae78588476b8947b87975a611bbcea8
parenta6be03f2e7145d65ad100bf0ff56e37e91071ae7 (diff)
parent2e3d5c866fdead26f9e0e2b5620b236fea95c0e7 (diff)
downloadrust-2ae06976e47f06bcf0b9d50fe2603add1204bf26.tar.gz
rust-2ae06976e47f06bcf0b9d50fe2603add1204bf26.zip
Rollup merge of #60278 - ehuss:doc-html_root_url, r=GuillaumeGomez
Document the `html_root_url` doc attribute value.

I'm not sure if this was intentionally not documented, but I think it would be good to include. This was added in #9691.  `--extern-html-root-url` is unstable, but I don't think it hurts to mention it.
-rw-r--r--src/doc/rustdoc/src/the-doc-attribute.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/doc/rustdoc/src/the-doc-attribute.md b/src/doc/rustdoc/src/the-doc-attribute.md
index 61e5b3d0133..b165c5a6b3b 100644
--- a/src/doc/rustdoc/src/the-doc-attribute.md
+++ b/src/doc/rustdoc/src/the-doc-attribute.md
@@ -92,6 +92,21 @@ the tracking issue.
 #![doc(issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/")]
 ```
 
+### `html_root_url`
+
+The `#[doc(html_root_url = "…")]` attribute value indicates the URL for
+generating links to external crates. When rustdoc needs to generate a link to
+an item in an external crate, it will first check if the extern crate has been
+documented locally on-disk, and if so link directly to it. Failing that, it
+will use the URL given by the `--extern-html-root-url` command-line flag if
+available. If that is not available, then it will use the `html_root_url`
+value in the extern crate if it is available. If that is not available, then
+the extern items will not be linked.
+
+```rust,ignore
+#![doc(html_root_url = "https://docs.rs/serde/1.0")]
+```
+
 ### `html_no_source`
 
 By default, `rustdoc` will include the source code of your program, with links