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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_d2_plugin-1.7.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mkdocs_d2_plugin-1.7.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for mkdocs_d2_plugin-1.7.0.tar.gz
Algorithm Hash digest
SHA256 607462a3bf3d28b0574214d400820f86c0c9f43466fdf73243e7f9f2e3d21584
MD5 17cc742332aabe0f463110869f4f000a
BLAKE2b-256 b32617e92ae5f577eefe6fd9b15fb80e03c8e672b5477eb5501ce66277ea69a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mkdocs_d2_plugin-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c40092738c77d4b8b03880f01f4ef433de07fb8c4bbf9540819e161b6440e3f
MD5 9f46d91cf0d8436757dcd01e0540f158
BLAKE2b-256 f13b002528206eb503287cb320ca9ac34f16159d41d9b77dd7ec594ebc2e4cae

See more details on using hashes here.

Supported by

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