parent
fcceee4761
commit
d6ea4e3f7a
|
@ -40,7 +40,7 @@ The path to the file has to be relative from the current source file.
|
||||||
mdBook will interpret included files as Markdown. Since the include command
|
mdBook will interpret included files as Markdown. Since the include command
|
||||||
is usually used for inserting code snippets and examples, you will often
|
is usually used for inserting code snippets and examples, you will often
|
||||||
wrap the command with ```` ``` ```` to display the file contents without
|
wrap the command with ```` ``` ```` to display the file contents without
|
||||||
interpretting them.
|
interpreting them.
|
||||||
|
|
||||||
````hbs
|
````hbs
|
||||||
```
|
```
|
||||||
|
@ -49,7 +49,7 @@ interpretting them.
|
||||||
````
|
````
|
||||||
|
|
||||||
## Including portions of a file
|
## Including portions of a file
|
||||||
Often you only need a specific part of the file e.g. relevant lines for an
|
Often you only need a specific part of the file, e.g. relevant lines for an
|
||||||
example. We support four different modes of partial includes:
|
example. We support four different modes of partial includes:
|
||||||
|
|
||||||
```hbs
|
```hbs
|
||||||
|
@ -68,8 +68,8 @@ consisting of lines 2 to 10.
|
||||||
To avoid breaking your book when modifying included files, you can also
|
To avoid breaking your book when modifying included files, you can also
|
||||||
include a specific section using anchors instead of line numbers.
|
include a specific section using anchors instead of line numbers.
|
||||||
An anchor is a pair of matching lines. The line beginning an anchor must
|
An anchor is a pair of matching lines. The line beginning an anchor must
|
||||||
match the regex "ANCHOR:\s*[\w_-]+" and similarly the ending line must match
|
match the regex `ANCHOR:\s*[\w_-]+` and similarly the ending line must match
|
||||||
the regex "ANCHOR_END:\s*[\w_-]+". This allows you to put anchors in
|
the regex `ANCHOR_END:\s*[\w_-]+`. This allows you to put anchors in
|
||||||
any kind of commented line.
|
any kind of commented line.
|
||||||
|
|
||||||
Consider the following file to include:
|
Consider the following file to include:
|
||||||
|
|
Loading…
Reference in New Issue