Skip to content

Commit

Permalink
Readme.md: document how to use include statements
Browse files Browse the repository at this point in the history
Closes #31.
  • Loading branch information
flokli committed Apr 28, 2022
1 parent 2673e45 commit 7af0fdc
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,30 @@ or
MDBOOK_preprocessor__graphviz__output_to_file="true" mdbook build
```

### Embedding dot files
Sometimes you don't want to write dot code, but instead include it from a file:

~~~markdown
```dot
{{#include path/to/file.dot}}
```
~~~

In this case, you might want to modify the order of preprocessors, so the
include directives get resolved before it's passed to Graphviz.

In that case, make sure your `[preprocessor.graphviz]` section in the config
orders itself after `links`:

```toml
[preprocessor.graphviz]
after = ["links"]
```

More information about preprocessors and ordering can be found
[here](https://rust-lang.github.io/mdBook/format/configuration/preprocessors.html?highlight=preprocessors#require-a-certain-order).


### .gitignore

This `.gitignore` should cover the generated SVG files.
Expand Down

0 comments on commit 7af0fdc

Please sign in to comment.