Pandoc filter to convert d2 code blocks to images.
```{.d2 pad=20}
x -> y
```
Install it with pip:
pip install pandoc-d2-filter
And use it like any other pandoc filter:
pandoc tests/testdata/default.md -o default.pdf --filter pandoc-d2
The d2 binary is either part of the $PATH
or can be configured via D2_BIN
environment variable.
If you use other output formats than svg,
you should d2 init-playwright
before the first use.
TODO check tests/testdata
for now.
This filter is heavily inspired by the JavaScript d2-filter and the pandoc-plantuml-filter.