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: book-example/src/format/mdbook.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -29,18 +29,18 @@ Will render as
29
29
With the following syntax, you can include files into your book:
30
30
31
31
```hbs
32
-
{{#include file.rs}}
32
+
\{{#include file.rs}}
33
33
```
34
34
35
35
The path to the file has to be relative from the current source file.
36
36
37
37
Usually, this command is used for including code snippets and examples. In this case, oftens one would include a specific part of the file e.g. which only contains the relevant lines for the example. We support four different modes of partial includes:
38
38
39
39
```hbs
40
-
{{#include file.rs:2}}
41
-
{{#include file.rs::10}}
42
-
{{#include file.rs:2:}}
43
-
{{#include file.rs:2:10}}
40
+
\{{#include file.rs:2}}
41
+
\{{#include file.rs::10}}
42
+
\{{#include file.rs:2:}}
43
+
\{{#include file.rs:2:10}}
44
44
```
45
45
46
46
The first command only includes the second line from file `file.rs`. The second command includes all lines up to line 10, i.e. the lines from 11 till the end of the file are omitted. The third command includes all lines from line 2, i.e. the first line is omitted. The last command includes the excerpt of `file.rs` consisting of lines 2 to 10.
@@ -50,7 +50,7 @@ The first command only includes the second line from file `file.rs`. The second
50
50
With the following syntax, you can insert runnable Rust files into your book:
51
51
52
52
```hbs
53
-
{{#playpen file.rs}}
53
+
\{{#playpen file.rs}}
54
54
```
55
55
56
56
The path to the Rust file has to be relative from the current source file.
0 commit comments