MkDocs plugin for D2
Project description
mkdocs-d2-plugin
A plugin for the MkDocs documentation site generator which automatically generates and embeds D2 diagrams.
Requirements
Installation
Install the plugin using pip:
pip install mkdocs-d2-plugin
And add it to your mkdocs.yml
:
plugins:
- d2
Usage
The plugin will automatically generate and embed D2 diagrams from code blocks
with the d2
language tag.
Example
```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! ```
Configuration
The plugin can be configured globally in your mkdocs.yml
file.
plugins:
- d2:
theme: 1
sketch: False
pad: 100
scale: -1.0
Or locally in a code block.
```d2 theme=1 sketch=true pad=100 scale=-1.0 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! ```
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-0.1.0.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for mkdocs_d2_plugin-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 518e289e4d206242b9f401ac1a1be6b599013cef4fdaf36ba8d4a1a6e1c7980d |
|
MD5 | d8a4aab344da81284268772a48f8be54 |
|
BLAKE2b-256 | a90410cab03cefeaa936db373fc081a4f2f4759e9f0f7fb4906a7cd3c6acd38f |