Skip to main content

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

Metadata

Release files for mkdocs-d2-plugin 1.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkdocs-d2-plugin 1.7.0
File Size Uploaded
mkdocs_d2_plugin-1.7.0.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mkdocs-d2-plugin 1.7.0
File Interpreter ABI Platform
mkdocs_d2_plugin-1.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.2 kB

Release files / mkdocs_d2_plugin-1.7.0.tar.gz

Download URL mkdocs_d2_plugin-1.7.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
607462a3bf3d28b0574214d400820f86c0c9f43466fdf73243e7f9f2e3d21584
BLAKE2b-256 checksum
How to use checksums
b32617e92ae5f577eefe6fd9b15fb80e03c8e672b5477eb5501ce66277ea69a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Release files / mkdocs_d2_plugin-1.7.0-py3-none-any.whl

Download URL mkdocs_d2_plugin-1.7.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c40092738c77d4b8b03880f01f4ef433de07fb8c4bbf9540819e161b6440e3f
BLAKE2b-256 checksum
How to use checksums
f13b002528206eb503287cb320ca9ac34f16159d41d9b77dd7ec594ebc2e4cae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Release history Release notifications | RSS feed

This release

1.7.0 This release

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page