# 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
```
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.9",
"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/d1/5e/633f6898f323e5f032415baf18095bd24958986bfd06e8f23e5588a2af5d/mkdocs_d2_plugin-1.6.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* [Python](https://www.python.org/) >= 3.9\n* [MkDocs](https://www.mkdocs.org/) >= 1.6.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.6.0",
"project_urls": {
"Homepage": "https://github.com/landmaj/mkdocs-d2-plugin"
},
"split_keywords": [
"mkdocs",
"python",
"markdown",
"d2",
"diagram"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d3e1a9c15e4c351c9c0a7c35ea0e661df728d419838dcf99b078513f807c188d",
"md5": "c22d83cbe38dbec33d2bc9a7b2c22d2b",
"sha256": "7fef28dee4e01595db712ddc0853418b6834ff955f42b2bd2f9fad15c217c3fc"
},
"downloads": -1,
"filename": "mkdocs_d2_plugin-1.6.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c22d83cbe38dbec33d2bc9a7b2c22d2b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 8547,
"upload_time": "2024-12-16T11:39:48",
"upload_time_iso_8601": "2024-12-16T11:39:48.784865Z",
"url": "https://files.pythonhosted.org/packages/d3/e1/a9c15e4c351c9c0a7c35ea0e661df728d419838dcf99b078513f807c188d/mkdocs_d2_plugin-1.6.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d15e633f6898f323e5f032415baf18095bd24958986bfd06e8f23e5588a2af5d",
"md5": "299aac9f93380247ce9f4d98fc4afb4e",
"sha256": "42c1f2dc2ee9fa898c620e011f226de0d90ab4cd2640560199d7f919589a591b"
},
"downloads": -1,
"filename": "mkdocs_d2_plugin-1.6.0.tar.gz",
"has_sig": false,
"md5_digest": "299aac9f93380247ce9f4d98fc4afb4e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 8068,
"upload_time": "2024-12-16T11:39:49",
"upload_time_iso_8601": "2024-12-16T11:39:49.956375Z",
"url": "https://files.pythonhosted.org/packages/d1/5e/633f6898f323e5f032415baf18095bd24958986bfd06e8f23e5588a2af5d/mkdocs_d2_plugin-1.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-16 11:39:49",
"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"
}