MkDocs plugin for D2
Project Links
Meta
Author: Michał Wieluński
Requires Python: >=3.9
Classifiers
Development Status
- 5 - Production/Stable
Intended Audience
- Developers
- Information Technology
- Science/Research
License
- OSI Approved :: MIT License
Programming Language
- Python
- Python :: 3 :: Only
- Python :: 3.9
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
mkdocs-d2-plugin
A plugin for embedding D2 diagrams in MkDocs.
Documentation and live demo can be found here.
Requirements
Installation
Install the plugin using pip:
pip install mkdocs-d2-plugin
And add it to your mkdocs.yml
:
plugins:
- d2
Usage
Fenced code block
```d2
shape: sequence_diagram
Alice -> John: Hello John, how are you?
Alice -> John.ack: John, can you hear me?
John.ack -> Alice: Hi Alice, I can hear you!
John -> Alice: I feel great!
```
Image tag

Demo app
You can find demo app in the docs
directory.
Live version is available here.
To run in locally:
cd docs
python3 -m venv .venv
source .venv/bin/activate
pip install mkdocs-material mkdocs-d2-plugin
mkdocs serve
To run it using Docker:
cd docs
docker build --tag mkdocs-d2-plugin:latest .
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs mkdocs-d2-plugin:latest
Dec 16, 2024
1.6.0
Aug 21, 2024
1.5.0
Aug 20, 2024
1.5.0b2
Aug 18, 2024
1.4.0
May 22, 2024
1.3.4
May 07, 2024
1.3.3
May 07, 2024
1.3.2
May 07, 2024
1.3.1
Mar 31, 2024
1.3.0
Mar 21, 2024
1.2.3
Jan 03, 2024
1.2.2
Dec 22, 2023
1.2.0
Nov 06, 2023
1.1.0
Nov 06, 2023
1.0.1
Nov 05, 2023
1.0.0
Nov 04, 2023
0.4.1
Nov 04, 2023
0.4.0
Nov 04, 2023
0.3.0
Sep 26, 2023
0.2.2
Sep 26, 2023
0.2.1
Sep 26, 2023
0.2.0
Sep 25, 2023
0.1.0
Sep 23, 2023
0.0.3
Sep 23, 2023
0.0.2
Sep 22, 2023
0.0.1