Skip to content

Commit 84d4063

Browse files
ezubriskiDylan-DPC
authored andcommitted
Fix-681 (#954)
* Adding section for code snippets. * Reformatting sections. * Update mdbook.md
1 parent 07830f7 commit 84d4063

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

book-example/src/format/mdbook.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,20 @@ With the following syntax, you can include files into your book:
3535

3636
The path to the file has to be relative from the current source file.
3737

38-
Usually, this command is used for including code snippets and examples. In this
39-
case, oftens one would include a specific part of the file e.g. which only
40-
contains the relevant lines for the example. We support four different modes of
41-
partial includes:
38+
mdBook will interpret included files as markdown. Since the include command
39+
is usually used for inserting code snippets and examples, you will often
40+
wrap the command with ```` ``` ```` to display the file contents without
41+
interpretting them.
42+
43+
````hbs
44+
```
45+
\{{#include file.rs}}
46+
```
47+
````
48+
49+
## Including portions of a file
50+
Often you only need a specific part of the file e.g. relevant lines for an
51+
example. We support four different modes of partial includes:
4252

4353
```hbs
4454
\{{#include file.rs:2}}

0 commit comments

Comments
 (0)