Metadata-Version: 2.4
Name: mkdocs-d2-plugin
Version: 1.6.0
Summary: MkDocs plugin for D2
Home-page: https://github.com/landmaj/mkdocs-d2-plugin
Author: Michał Wieluński
Author-email: michal@wielunski.net
License: MIT
Keywords: mkdocs python markdown d2 diagram
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mkdocs>=1.6.0
Requires-Dist: pymdown-extensions>=9.0
Requires-Dist: pydantic>=2.0
Requires-Dist: packaging
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# mkdocs-d2-plugin

A plugin for embedding D2 diagrams in MkDocs.

**Documentation and live demo can be found
[here](https://landmaj.github.io/mkdocs-d2-plugin/).**

## Requirements

* [Python](https://www.python.org/) >= 3.9
* [MkDocs](https://www.mkdocs.org/) >= 1.6.0
* [D2](https://d2lang.com) >= 0.6.3

## Installation

Install the plugin using pip:

```bash
pip install mkdocs-d2-plugin
```

And add it to your `mkdocs.yml`:

```yaml
plugins:
  - d2
```

## Usage

### Fenced code block

````md
```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

```md
![Diagram](diagram.d2)
```

## Demo app

You can find demo app in the `docs` directory.
Live version is available [here](https://landmaj.github.io/mkdocs-d2-plugin/).

To run in locally:

```bash
cd docs
python3 -m venv .venv
source .venv/bin/activate
pip install mkdocs-material mkdocs-d2-plugin
mkdocs serve
```

To run it using Docker:

```bash
cd docs
docker build --tag mkdocs-d2-plugin:latest .
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs mkdocs-d2-plugin:latest
```
