Skip to content

Missing play.rust-lang.org links in TRPL book #21553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mbrubeck opened this issue Jan 23, 2015 · 2 comments
Closed

Missing play.rust-lang.org links in TRPL book #21553

mbrubeck opened this issue Jan 23, 2015 · 2 comments
Assignees
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@mbrubeck
Copy link
Contributor

http://doc.rust-lang.org/book/ is supposed to "run these examples on play.rust-lang.org by clicking on the arrow that appears in the upper right of the example when you mouse over the code" but these arrows don't seem to appear in any of the code samples.

@steveklabnik steveklabnik added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jan 23, 2015
@steveklabnik
Copy link
Member

My understanding is that rustdoc should be adding these, unsure why it's not.

@jatinn
Copy link
Contributor

jatinn commented Feb 7, 2015

Looked into this and saw a few things incase anyone else is looking into it.

  1. "--markdown-playground-url=http://play.rust-lang.org".to_string(), is missing from the rustdoc_args in src/rustbook/build.rs. Adding this however does not get it to work because of the next items.
  2. The template used to render the rustbook is from src/librustdoc/markdown.rs where as for the documentation it is in src/librustdoc/html/layout.rs. This is important as the template in layout.rs includes the playpen.js.
  3. I tried to include playpen.js into the output but this still did not work, it is missing the tag from which it gets the code. This seems to be because s.push_str(&format!("<span class='rusttest'>{}</span>", Escape(&test))); line does not get executed in src/librustdoc/html/markdown.rs

Hope this helps.

@alexcrichton alexcrichton self-assigned this Apr 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants