wg-async icon indicating copy to clipboard operation
wg-async copied to clipboard

Diable playpen on code blocks

Open pineapplehunter opened this issue 4 years ago • 2 comments

Hi, thanks for the nice book! I was looking at the book and wanted to see some outputs on some examples, but it seems like almost all the code in this book are not runnable. Should the run button be disabled?

pineapplehunter avatar May 19 '21 13:05 pineapplehunter

Yes, I think you're right. Most of the examples aren't meant to be runnable code.

To disable the run button on individual codeblocks, I think you can add the "noplayground" tag, like this:

```rust,noplayground
fn some_rust_code_here() {}
```

It may also be possible to disable the playground integration bookwide, but I'm not sure.

eminence avatar May 24 '21 03:05 eminence

Disabling individual codeblocks with noplayground seems to work, but disabling for the whole book does not seem to be implemented yet. See https://github.com/rust-lang/mdBook/issues/747 .

Would it help if I make a PR that adds noplayground to every codeblock? Or would that just make it hard to maintain?

pineapplehunter avatar May 25 '21 03:05 pineapplehunter