You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/meta/playground.md
+11-4Lines changed: 11 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# Playground
2
2
3
-
The [Rust Playground](https://play.rust-lang.org/) is a way to experiment with Rust code through a web interface.
3
+
The [Rust Playground](https://play.rust-lang.org/) is a way to experiment with
4
+
Rust code through a web interface.
4
5
5
6
## Using it with `mdbook`
6
7
@@ -12,15 +13,18 @@ fn main() {
12
13
}
13
14
```
14
15
15
-
This allows the reader to both run your code sample, but also modify and tweak it. The key here is the adding the word `editable` to your codefence block separated by a comma.
16
+
This allows the reader to both run your code sample, but also modify and tweak
17
+
it. The key here is the adding the word `editable` to your codefence block
18
+
separated by a comma.
16
19
17
20
````markdown
18
21
```rust,editable
19
22
//...place your code here
20
23
```
21
24
````
22
25
23
-
Additionally, you can add `ignore` if you want `mdbook` to skip your code when it builds and tests.
26
+
Additionally, you can add `ignore` if you want `mdbook` to skip your code when
27
+
it builds and tests.
24
28
25
29
````markdown
26
30
```rust,editable,ignore
@@ -30,7 +34,10 @@ Additionally, you can add `ignore` if you want `mdbook` to skip your code when i
30
34
31
35
## Using it with docs
32
36
33
-
You may have noticed in some of the [official Rust docs][official-rust-docs] a button that says "Run", which opens the code sample up in a new tab in Rust Playground. This feature is enabled if you use the #[doc] attribute called [`html_playground_url`][html-playground-url].
37
+
You may have noticed in some of the [official Rust docs][official-rust-docs] a
38
+
button that says "Run", which opens the code sample up in a new tab in Rust
39
+
Playground. This feature is enabled if you use the `#[doc]` attribute called
0 commit comments