Skip to main content

Django template tag for showing mermaid diagrams

Project description

Django Mermaid

Django template tag for showing mermaid diagrams.

PyPI License PRs Welcome Tests

Install

python -m pip install django-mermaid

Configuration

Add the django_mermaid.apps.MermaidConfig to your INSTALLED_APPS setting:

INSTALLED_APPS = [
    ...,  # other apps
    'django_mermaid.apps.MermaidConfig',
]

Usage

Once you have installed the app, you can use the mermaid template tag in your templates.

{% load mermaid %}
{% mermaid "graph LR; A-->B;" %}

By default, Django Mermaid uses the 9.4.3 version of mermaid. However, if you want to use a specific version of mermaid, you can set the MERMAID_VERSION variable in your Django project's settings.py file.

MERMAID_VERSION = '10.0.3-alpha.1'

Make sure the version you specify is available on the mermaid CDN, and has the mermaid.min.js file.

Contribute

Any contribution is welcome. If you have any ideas or suggestions, feel free to open an issue or a pull request. And don't forget to add tests for your changes.

License

Copyright (C) 2023 Artyom Vancyan. MIT

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

django-mermaid-0.0.3.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

django_mermaid-0.0.3-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page