Skip to content
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

'Run' button on the nightly error index doesn't open playground #36910

Closed
m-decoster opened this issue Oct 2, 2016 · 4 comments
Closed

'Run' button on the nightly error index doesn't open playground #36910

m-decoster opened this issue Oct 2, 2016 · 4 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@m-decoster
Copy link
Contributor

In the compiler error index, like in other parts of the documentation, it is possible to click a 'Run' button to open a playground containing the code from a <code> block. Unlike in other parts of the documentation, this does not work, and opens the same page in a new tab instead.

The issue in the page's HTML is that the href attribute of the a element that shows the button is blank:

<a class="test-arrow" target="_blank" href="">Run</a>.

In other parts of the documentation (e.g. the rust reference), this is not the case:

<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=fn%20main()%20%7B%0A%20%20%20%20let%20a%20%3D%20%22foobar%22%3B%0Alet%20b%20%3D%20%22foo%5C%0A%20%20%20%20%20%20%20%20%20bar%22%3B%0A%0Aassert_eq!(a%2Cb)%3B%0A%7D">Run</a>.

This is likely an issue in the HTML generation, but I have not pinned down where exactly the generation goes wrong.

@bluss bluss added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Oct 2, 2016
@bluss
Copy link
Member

bluss commented Oct 2, 2016

I think this is just issue #36621

@m-decoster
Copy link
Contributor Author

This issue will probably be solved when yours is solved, so should this be closed? @GuillaumeGomez

@bluss
Copy link
Member

bluss commented Oct 3, 2016

Closed as duplicate.

@bluss bluss closed this as completed Oct 3, 2016
@bluss
Copy link
Member

bluss commented Oct 9, 2016

It doesn't look like this issue will be solved together with the other.

@bluss bluss reopened this Oct 9, 2016
bors added a commit that referenced this issue Oct 16, 2016
rustdoc: Improve playground run buttons

The main change is to stop using javascript to generate the URLs and use
rustdoc instead.

This also adds run buttons to the error index examples.

You can test the changes at https://ollie27.github.io/rust_doc_test/.

Fixes #36621
Fixes #36910
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

2 participants