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.2.2.tar.gz (6.0 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.2.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs-d2-plugin-1.2.2.tar.gz.

File metadata

  • Download URL: mkdocs-d2-plugin-1.2.2.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for mkdocs-d2-plugin-1.2.2.tar.gz
Algorithm Hash digest
SHA256 9f74701d4dc3e3dd181d0601d60126bed99deec0de34e7a55c6e239780e68b21
MD5 8350f2b5bb16e418e0697d33ee42d373
BLAKE2b-256 be5fdeca45768d80ebf417e864a6c376a510ce12ee6d033dc59b3bdaa8884d8d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mkdocs_d2_plugin-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 61fd65c540ded8b70d1e7b552e441db46ec0b8a2aa8776218efb90067bd15c93
MD5 c84d99ac9f60fe7560063262174f946c
BLAKE2b-256 a330f99665828774ff70603ca384cd2dc117ac386927797bde11b8fcb78db848

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