Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme.md: document how to use include statements #33

Merged
merged 1 commit into from
Apr 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).