diff --git a/docs/ui-components/code.md b/docs/ui-components/code.md index ecd1a02..9a4df73 100644 --- a/docs/ui-components/code.md +++ b/docs/ui-components/code.md @@ -158,6 +158,27 @@ mermaid: path: "/assets/js/mermaid.min.js" ``` +### Using mermaid with AsciiDoc + +Users of [AsciiDoc](https://asciidoc.org/) (e.g. via [jekyll-asciidoc](https://github.com/asciidoctor/jekyll-asciidoc)) may need additional configuration to use mermaid. + +By default, AsciiDoc generates HTML markup that mermaid cannot properly parse. The simplest way to resolve this is to use a [passthrough block](https://docs.asciidoctor.org/asciidoc/latest/pass/pass-block/): +{% highlight asciidoc %} +++++ +
+graph TD; + A-->B; + A-->C; + B-->D; + C-->D; ++++++ +{% endhighlight %} + +Alternatively, community member [@flyx](https://.github.com/flyx) has contributed a Ruby extension that does not require extra markup. The extension is available [as a GitHub Gist](https://gist.github.com/flyx/9fff080cf4edc95d495bc661a002232c). Thank you to [@flyx](https://.github.com/flyx)! + +The [asciidoctor-diagram](https://docs.asciidoctor.org/diagram-extension/latest/) extension which also supports mermaid is not recommended for use with Just the Docs, since it requires separate configuration e.g. for theming, and is known to not be trivial to set up. + ## Copy button {: .d-inline-block }