# 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
* [MkDocs](https://www.mkdocs.org/) >= 1.5.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
```
Raw data
{
"_id": null,
"home_page": "https://github.com/landmaj/mkdocs-d2-plugin",
"name": "mkdocs-d2-plugin",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "mkdocs python markdown d2 diagram",
"author": "Micha\u0142 Wielu\u0144ski",
"author_email": "michal@wielunski.net",
"download_url": "https://files.pythonhosted.org/packages/af/e4/fc440f08b3f5f4ce6b3e0c470dfe52939359e686593f1d5ceb756063730f/mkdocs-d2-plugin-1.3.0.tar.gz",
"platform": null,
"description": "# mkdocs-d2-plugin\n\nA plugin for embedding D2 diagrams in MkDocs.\n\n**Documentation and live demo can be found\n[here](https://landmaj.github.io/mkdocs-d2-plugin/).**\n\n## Requirements\n\n* [MkDocs](https://www.mkdocs.org/) >= 1.5.0\n* [D2](https://d2lang.com) >= 0.6.3\n\n## Installation\n\nInstall the plugin using pip:\n\n```bash\npip install mkdocs-d2-plugin\n```\n\nAnd add it to your `mkdocs.yml`:\n\n```yaml\nplugins:\n - d2\n```\n\n## Usage\n\n### Fenced code block\n\n````md\n```d2\nshape: sequence_diagram\nAlice -> John: Hello John, how are you?\nAlice -> John.ack: John, can you hear me?\nJohn.ack -> Alice: Hi Alice, I can hear you!\nJohn -> Alice: I feel great!\n```\n````\n\n### Image tag\n\n```md\n![Diagram](diagram.d2)\n```\n\n## Demo app\n\nYou can find demo app in the `docs` directory.\nLive version is available [here](https://landmaj.github.io/mkdocs-d2-plugin/).\n\nTo run in locally:\n\n```bash\ncd docs\npython3 -m venv .venv\nsource .venv/bin/activate\npip install mkdocs-material mkdocs-d2-plugin\nmkdocs serve\n```\n\nTo run it using Docker:\n\n```bash\ncd docs\ndocker build --tag mkdocs-d2-plugin:latest .\ndocker run --rm -it -p 8000:8000 -v ${PWD}:/docs mkdocs-d2-plugin:latest\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "MkDocs plugin for D2",
"version": "1.3.0",
"project_urls": {
"Homepage": "https://github.com/landmaj/mkdocs-d2-plugin"
},
"split_keywords": [
"mkdocs",
"python",
"markdown",
"d2",
"diagram"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3d376694fb56140ce78d5b8f3fb36c007834a5b9e18dd223d0343ca1625b674e",
"md5": "16ec4e6889a16c890bded42150a0bca6",
"sha256": "6670f98b6074ae74ab47e4a9db9e29d85140104e5ddef2da3dce8c22c2419c1b"
},
"downloads": -1,
"filename": "mkdocs_d2_plugin-1.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "16ec4e6889a16c890bded42150a0bca6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 7309,
"upload_time": "2024-03-31T10:12:38",
"upload_time_iso_8601": "2024-03-31T10:12:38.338338Z",
"url": "https://files.pythonhosted.org/packages/3d/37/6694fb56140ce78d5b8f3fb36c007834a5b9e18dd223d0343ca1625b674e/mkdocs_d2_plugin-1.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "afe4fc440f08b3f5f4ce6b3e0c470dfe52939359e686593f1d5ceb756063730f",
"md5": "0152135252bffa49fa245728d3493b34",
"sha256": "6a30da3bd5a821d9598483724947aaf56c935fe6cdbd69992194339618eeb793"
},
"downloads": -1,
"filename": "mkdocs-d2-plugin-1.3.0.tar.gz",
"has_sig": false,
"md5_digest": "0152135252bffa49fa245728d3493b34",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 6115,
"upload_time": "2024-03-31T10:12:40",
"upload_time_iso_8601": "2024-03-31T10:12:40.113435Z",
"url": "https://files.pythonhosted.org/packages/af/e4/fc440f08b3f5f4ce6b3e0c470dfe52939359e686593f1d5ceb756063730f/mkdocs-d2-plugin-1.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-31 10:12:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "landmaj",
"github_project": "mkdocs-d2-plugin",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mkdocs-d2-plugin"
}