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 fe2d983
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,26 @@ This `.gitignore` should cover the generated SVG files.
```
*.generated.svg
```

## 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).

0 comments on commit fe2d983

Please sign in to comment.