A jinja2 block to render a mermaid diagram
Project description
jinja2-mermaid-extension
A jinja2 block to render a mermaid diagram.
- Github repository: https://github.com/AdamGagorik/jinja2-mermaid-extension/
- Documentation https://AdamGagorik.github.io/jinja2-mermaid-extension/
Setup
Docker
must be installed to run themermaid
command line tool.- The extension should be installed in your
Python
environment.
pip install jinja2-mermaid-extension
- The extension should be added to the
jinja2
environment.
from jinja2 import Environment
from jinja2_mermaid_extension import MermaidExtension
env = Environment(extensions=[MermaidExtension])
Usage
The following jinaj2
block will be transformed into an image and referenced in the rendered string.
{% mermaid -%}
theme: default
scale: 3
width: 75
align: center
caption: |
An example mermaid diagram!
diagram: |
graph TD
A --> B
B --> C
A --> C
{% endmermaid %}
Repository initiated with fpgmaas/cookiecutter-poetry.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for jinja2_mermaid_extension-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0442d91697049e3e7e0928e528adada68ad4f7d0c7f2183ce118418a1e77e059 |
|
MD5 | 9559c88f5354e947cb4afa3c0738df98 |
|
BLAKE2b-256 | 30bab48963340f7b25e8c26e4e2cb6f170b12f8139eb05c25fc8c19acf1c4620 |
Close
Hashes for jinja2_mermaid_extension-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c66ae8dec0b53726106623c795f28faa192742f195eec037267e47f917731a8 |
|
MD5 | 8a95959fa0b2f8b5a4f964d31badc2f7 |
|
BLAKE2b-256 | 3e76a7c91b5813df020280e42abc68c77d7b7d9fb93c541d84478006fa64c328 |