Skip to main content

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


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.2.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

mkdocs_d2_plugin-1.3.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_d2_plugin-1.3.2.tar.gz.

File metadata

  • Download URL: mkdocs_d2_plugin-1.3.2.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for mkdocs_d2_plugin-1.3.2.tar.gz
Algorithm Hash digest
SHA256 81360be5612707b8b0017c58ebf8d5e8cbd06aafc05a4d6cbcd9588b2fa7f48b
MD5 aaab6990623559093465a89eeffd0395
BLAKE2b-256 a202939cea5f7e13b0fb92d43e371643bb4e48ef1f61c5e2bb10fb70fc3a76f9

See more details on using hashes here.

File details

Details for the file mkdocs_d2_plugin-1.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_d2_plugin-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 452ab832aa39a68fa5d3b69a7924327247d2f1413eaf30ea6c7054d05cb9fb39
MD5 13fc5098bc5085185f4a669c407ce0e4
BLAKE2b-256 8b5a2be2776d38737170aa0d8e503ada025708c7bd855661edf01b05f8b01c15

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page