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 name=sequence pad=50 scale=0.5 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! ```
Options
name
: output file name (required)pad
: pixels padded around the rendered diagram (default 100, optional)scale
: e.g. 0.5 to halve the default size; -1 means that SVG's will fit to screen; etting to 1 turns off SVG fitting to screen (default -1, optional)
Configuration
The plugin can be configured in your mkdocs.yml
file.
plugins:
- d2:
theme: 1
sketch: False
output_dir: assets/diagrams
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.0.2.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for mkdocs_d2_plugin-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 809e3ada6093a838a0263263a6aa6b2b645705915c344d63bed7178d809a4391 |
|
MD5 | 8b86562614460611d4c2ad4ec42183b3 |
|
BLAKE2b-256 | 82636e7d370a259332b39b8f4694e58fdbcfa144a283db07610ed865cf8d1e06 |