Pandoc filter for D2 code blocks
Project description
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 and the pandoc-plantuml-filter.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pandoc_d2_filter-0.1.0.tar.gz.
File metadata
- Download URL: pandoc_d2_filter-0.1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bde3b86a32edcc885669aff15addbcd48244ddfb5bdd2578c5ad8b263a1c2b0
|
|
| MD5 |
cc2de6d707319b5be1f54cc0a7339900
|
|
| BLAKE2b-256 |
a3b5fb4d42a4f58a294dabf8b617dcd3c9bc3482d4d93a624d3afdc40b53fc78
|
File details
Details for the file pandoc_d2_filter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pandoc_d2_filter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54da3a719af05e6c66296ce13417df245181747920fc628fb3eb6121f8c6d46b
|
|
| MD5 |
e789507388bf0fd3ac2ea7a2dbe0ba96
|
|
| BLAKE2b-256 |
9a55057f9f1cc2838b853f531bc396465ad0c57ce6ef7c21427b60e5a22e2ca0
|