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

Uploaded Source

Built Distribution

mkdocs_d2_plugin-1.5.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mkdocs_d2_plugin-1.5.0.tar.gz
Algorithm Hash digest
SHA256 d37cf890db315dff601bc1118dc26e5ad5533fb49d8c3b57f06d68badb3b52e4
MD5 b924b1ea16de94b0432e65a2231dd861
BLAKE2b-256 048776d3d05a5f71d4e9fbd055f5c3eaa003fd4b2c60b02e8ba0d0b85bbdef44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mkdocs_d2_plugin-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3206e637b6ca44d04f8ad061fc3baaa48e98da7cf4667724499489803abc86f
MD5 b7cfdf9ac74109e8826d5738486b1981
BLAKE2b-256 f8c9bae2b2378d41e38a4459795309e6f3e55bb1c8949b87430c2959d05eaf8a

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