MkDocs plugin for D2
Project description
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
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 mkdocs_d2_plugin-1.6.0.tar.gz.
File metadata
- Download URL: mkdocs_d2_plugin-1.6.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42c1f2dc2ee9fa898c620e011f226de0d90ab4cd2640560199d7f919589a591b
|
|
| MD5 |
299aac9f93380247ce9f4d98fc4afb4e
|
|
| BLAKE2b-256 |
d15e633f6898f323e5f032415baf18095bd24958986bfd06e8f23e5588a2af5d
|
File details
Details for the file mkdocs_d2_plugin-1.6.0-py3-none-any.whl.
File metadata
- Download URL: mkdocs_d2_plugin-1.6.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fef28dee4e01595db712ddc0853418b6834ff955f42b2bd2f9fad15c217c3fc
|
|
| MD5 |
c22d83cbe38dbec33d2bc9a7b2c22d2b
|
|
| BLAKE2b-256 |
d3e1a9c15e4c351c9c0a7c35ea0e661df728d419838dcf99b078513f807c188d
|