Metadata-Version: 2.1
Name: pandoc-d2-filter
Version: 0.1.0
Summary: Pandoc filter for D2 code blocks
Author-email: Fliiiix <hi@l33t.name>
License: MIT
Keywords: d2,pandoc-filter,pandoc
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandocfilters

pandoc-d2-filter
================

Pandoc filter to convert d2 code blocks to images.

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

## Usage

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.

## Configuration

TODO check `tests/testdata` for now.

## Inspiration

This filter is heavily inspired by the
[JavaScript d2-filter](https://github.com/ram02z/d2-filter)
and the [pandoc-plantuml-filter](https://github.com/timofurrer/pandoc-plantuml-filter).

Thanks [Omar](https://github.com/ram02z) & [Timo](https://github.com/timofurrer)
