1
Fork 0

book: Emit links to play.rust-lang.org to run examples

Had to fix a bug in `--markdown-playground-url` for markdown files in rustdoc as
well as adding some necessary JS to the rustbook output as well.

Closes #21553
This commit is contained in:
Alex Crichton 2015-04-07 11:23:14 -07:00
parent 0f3183f42b
commit 947f1b66cb
3 changed files with 12 additions and 1 deletions

View file

@ -59,7 +59,7 @@ pub fn render(input: &str, mut output: PathBuf, matches: &getopts::Matches,
let input_str = load_or_return!(input, 1, 2);
let playground = matches.opt_str("markdown-playground-url");
if playground.is_some() {
markdown::PLAYGROUND_KRATE.with(|s| { *s.borrow_mut() = None; });
markdown::PLAYGROUND_KRATE.with(|s| { *s.borrow_mut() = Some(None); });
}
let playground = playground.unwrap_or("".to_string());