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
![Diagram](diagram.d2)
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
mkdocs_d2_plugin-1.3.1.tar.gz
(6.1 kB
view hashes)
Built Distribution
Close
Hashes for mkdocs_d2_plugin-1.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f862c7fd61626dec4ad2931b11823e8a6c410ca31b1de17dc2cf13014d299889 |
|
MD5 | 9404fb4f41dc533affd47404315d0d8a |
|
BLAKE2b-256 | b103a9452cd89c64f25c2104ed9be3f224fdebf27675d4f30b11d5c45532cf00 |