From f8d48649dfd7a793337863796430576c48aa802f Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 29 Apr 2022 21:19:42 +0200 Subject: [PATCH] Readme.md: document how to use include statements (#33) Closes https://github.com/dylanowen/mdbook-graphviz/issues/31. --- Readme.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Readme.md b/Readme.md index cd9c28d..b5885f4 100644 --- a/Readme.md +++ b/Readme.md @@ -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).