Home

Awesome

d2-filter

d2-filter is a pandoc filter that adds D2 syntax diagrams in markdown documents.

Example

~~~{.d2 pad=20}
x -> y
~~~

Output

Usage

# Installation
npm i -g d2-filter

# Unix
pandoc -F d2-filter test.md -o test.pdf
# Windows
pandoc -F d2-filter.cmd test.md -o test.pdf

If using with Quarto, you can use quarto-d2 to avoid issues with pandoc filters.

Configuration

Using attributes of the fenced code block, you can specify:

Credits

License

MIT