diff options
| author | QuietMisdreavus <grey@quietmisdreavus.net> | 2018-03-15 14:44:17 -0500 |
|---|---|---|
| committer | QuietMisdreavus <grey@quietmisdreavus.net> | 2018-03-15 14:44:17 -0500 |
| commit | 5d8443aeb1bf441897efddfc1246377f0d51149d (patch) | |
| tree | c835eb433dd8e5e0b52dc5c602b70935b8f19917 /src/doc | |
| parent | bb328237fc68fcc9c0495b283da74f8ec361b371 (diff) | |
| download | rust-5d8443aeb1bf441897efddfc1246377f0d51149d.tar.gz rust-5d8443aeb1bf441897efddfc1246377f0d51149d.zip | |
talk about --playground-url
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/rustdoc/src/unstable-features.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index 873aebfc777..9cb5760ec37 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -231,3 +231,26 @@ Just like `--html-after-content`, this allows you to insert extra content before but after the other content `rustdoc` would normally produce in the rendered documentation. However, instead of directly inserting the file verbatim, `rustdoc` will pass the files through a Markdown renderer before inserting the result into the file. + +### `--playground-url`: control the location of the playground + +Using this flag looks like this: + +```bash +$ rustdoc src/lib.rs -Z unstable-options --playground-url https://play.rust-lang.org/ +``` + +When rendering a crate's docs, this flag gives the base URL of the Rust Playground, to use for +generating `Run` buttons. Unlike `--markdown-playground-url`, this argument works for standalone +Markdown files *and* Rust crates. This works the same way as adding `#![doc(html_playground_url = +"url")]` to your crate root, as mentioned in [the chapter about the `#[doc]` +attribute][doc-playground]. Please be aware that the official Rust Playground at +https://play.rust-lang.org does not have every crate available, so if your examples require your +crate, make sure the playground you provide has your crate available. + +[doc-playground]: the-doc-attribute.html#html_playground_url + +If both `--playground-url` and `--markdown-playground-url` are present when rendering a standalone +Markdown file, the URL given to `--markdown-playground-url` will take precedence. If both +`--playground-url` and `#![doc(html_playground_url = "url")]` are present when rendering crate docs, +the attribute will take precedence. |
