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

Document mdBook playpen attributes #602

Closed
projektir opened this issue Feb 2, 2018 · 5 comments · Fixed by #1710
Closed

Document mdBook playpen attributes #602

projektir opened this issue Feb 2, 2018 · 5 comments · Fixed by #1710
Labels
A-Documentation Area: Documentation A-Playground Area: Playground E-Easy Experience: Easy E-Help-wanted Experience: Help Needed

Comments

@projektir
Copy link
Contributor

There does not appear to be documentation for the various playpen attributes in the UserGuide. I.e.:

  • editable
  • ignore
  • mdbook-runnable
@mattico mattico self-assigned this Jul 26, 2018
@ehuss ehuss added the A-Documentation Area: Documentation label May 17, 2019
@ehuss ehuss added A-Playground Area: Playground E-Easy Experience: Easy labels May 17, 2019
@uint
Copy link
Contributor

uint commented Nov 23, 2019

Looks like editable is already documented by now.

Correct me where I'm wrong! As far as I can understand, ignore and noplaypen do the exact same thing and remove the run button. mdbook-runnable overwrites both and makes the thing runnable again, though I'm not sure what use case that would have?

The logic I found for this is in the specific renderers. Is there more that I've missed?

@ehuss
Copy link
Contributor

ehuss commented Dec 4, 2019

There is a subtle distinction from ignore and noplaypen where noplaypen blocks will still be tested. It might be good to include the rustdoc attrs since they are relevant to how things work. And some examples would be good, too.

  • editable — Allows a code block to be editable, requires output.html.playpen.editable=true in config.
  • noplaypen — Will not show playground link, but will be tested. (Need to also specify rust.)
  • mdbook-runnable — Forces the playground link to be shown. This is intended to be combined with the ignore attr for examples that you don't want to test, but want to allow the reader to run.
  • ignore — Skips Rust tests, will not show playground link.
  • should_panic — Rust code should panic when run. Shows playground link.
  • no_run — Rust code should build, but not be run during a test. Shows playground link.
  • compile_fail — Rust code should fail to compile. Shows playground link.
  • edition2015 or edition2018 — Specifies the Rust edition.

UPDATE: See #1249 where some of these have changed.

@ISSOtm
Copy link
Contributor

ISSOtm commented May 25, 2021

UPDATE: See #1249 where some of these have changed.

The PR ID looks wrong, I'm not sure which changes this is mentioning. Otherwise, I'd be ready to tackle this.

In the meantime, could the OP be updated with a task list of the attributes that need to be documented?

@ehuss
Copy link
Contributor

ehuss commented May 29, 2021

I think #1249 is correct. no_run was changed so that it does not show the playground "play" button. I'm not sure if that changed any of the others (offhand I don't think it did, but it would be good to verify).

The list in #602 (comment) should be mostly complete with one change that noplayground has been renamed noplaypen. It might also be nice to link to the rustdoc docs here.

Otherwise, it would be good to verify the behavior of the list in #602 (comment), and a PR would be very appreciated!

@ehuss ehuss added the E-Help-wanted Experience: Help Needed label Jul 6, 2021
@danielparks
Copy link

Clarification for future people who stumble upon this: “playpen” is now ”playground,” not the other way around (see #1241). In other words, use noplayground if you want to disable the play link.

(Sorry for the noise. Apparently GitHub thinks you need to know every time I push a change to a commit.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Documentation Area: Documentation A-Playground Area: Playground E-Easy Experience: Easy E-Help-wanted Experience: Help Needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants