]> git.lizzy.rs Git - rust.git/commit
Auto merge of #37763 - liigo:rustdoc-playground, r=alexcrichton
authorbors <bors@rust-lang.org>
Fri, 18 Nov 2016 09:47:01 +0000 (01:47 -0800)
committerGitHub <noreply@github.com>
Fri, 18 Nov 2016 09:47:01 +0000 (01:47 -0800)
commit01d061fdc04ed78ff65138e96c212ecc678a9f8f
tree2b5e0151b2d33853dce12c334098ec397b84268d
parent509d14fc70d673bd01c7721481f63cb1bc503103
parentdc3859d73e77a34b1a61fd4f23d18651bf515b80
Auto merge of #37763 - liigo:rustdoc-playground, r=alexcrichton

rustdoc: add cli argument `--playground-url`

Add a new cli argument `--playground-url` for rustdoc:

`rustdoc lib.rs --playground-url="https://play.rust-lang.org/"`

`rustdoc book.md --playground-url="https://play.rust-lang.org/"`

This makes it possible for tools like https://docs.rs to generate crate docs that can submit samples code to run at https://play.rust-lang.org, even if the crate's author *forgot* putting `#![doc(html_playground_url = "https://play.rust-lang.org/")]` to crate root. By the way, I'd like to say, many crate authors are not aware of existing of `#![doc(html_playground_url = "https://play.rust-lang.org/")]`.

`--playground-url` may be reset by `--markdown-playground-url` or `#![doc(html_playground_url=...)]`, so it's backward compatible.

@alexcrichton since you implemented playground-url related features.
src/librustdoc/html/render.rs