MkDocs plugin for embedding BPMN files via bpmn-js
Project description
mkdocs-bpmn-js
mkdocs-bpmn-js is a simple MkDocs plugin that enables you to embed BPMN diagrams directly into your documentation using bpmn-js. Diagrams are embedded just like images, using Markdown syntax.
Installation
Install via pip:
pip install mkdocs-bpmn-js
Then enable the plugin in your mkdocs.yml:
plugins:
- bpmn-js
Plugin Options
You can configure the plugin by adding options under bpmn-js in mkdocs.yml.
plugins:
- bpmn-js:
viewer_js: "https://unpkg.com/bpmn-js@18/dist/bpmn-navigated-viewer.production.min.js"
viewer_css: "https://unpkg.com/bpmn-js@18/dist/assets/bpmn-js.css"
class: "mk-bpmn-js"
| Option | Description | Default Value |
|---|---|---|
viewer_js |
URL to the BPMN viewer JavaScript file. | https://unpkg.com/bpmn-js@18/dist/bpmn-navigated-viewer.production.min.js |
viewer_css |
URL to the BPMN viewer CSS file. | https://unpkg.com/bpmn-js@18/dist/assets/bpmn-js.css |
viewer_initialize |
Append a script to load the diagrams. | True |
class |
CSS class applied to each diagram container. | mk-bpmn-js |
Local viewer assets
If you prefer not to load assets from a CDN, you can host the required BPMN viewer files yourself.
mkdir -p theme/js theme/css
curl -L https://unpkg.com/bpmn-js@18/dist/bpmn-navigated-viewer.production.min.js > theme/js/bpmn.js
curl -L https://unpkg.com/bpmn-js@18/dist/assets/bpmn-js.css > theme/css/bpmn.css
Override the default theme to include your local assets by creating a custom theme/main.html template.
Refer to the MkDocs guide on customizing themes for more details.
{% extends "base.html" %}
{% block styles %}
{{ super() }}
<link rel="stylesheet" href="{{ base_url }}/css/bpmn.css" />
{% endblock %}
{% block libs %}
{{ super() }}
<script src="{{ base_url }}/js/bpmn.js"></script>
{% endblock %}
Finally, disable the default CDN links by setting the plugin options to empty strings in mkdocs.yml:
plugins:
- bpmn-js:
viewer_js: ""
viewer_css: ""
Usage
Add .bpmn files using standard Markdown image syntax:
<!-- Relative path to the current Markdown file -->

<!-- Absolute path from the site root -->

<!-- No alternative text -->

<!-- With diagram options (see below for more details) -->

The alternative text is optional and will be rendered as a link to the diagram file within a noscript element.
Diagram Options
You can customize individual diagrams using query parameters in the image URL.

| Parameter | Description | Example |
|---|---|---|
id |
Sets the HTML id of the viewer canvas. Useful for linking. |
id=my-diagram |
width |
Sets the diagram width. Accepts any valid CSS width value. | width=100%25 |
height |
Sets the diagram height. Accepts any valid CSS height value. | height=300px |
Acknowledgments
- Inspired by mkdocs-drawio, which served as a helpful reference for embedding diagrams in MkDocs.
- Also check out mkdocs-bpmn, an alternative implementation. Depending on your needs, it might be a better fit.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocs_bpmn_js-0.1.0.tar.gz.
File metadata
- Download URL: mkdocs_bpmn_js-0.1.0.tar.gz
- Upload date:
- Size: 37.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0575ce1a94be640269c8d594dabf98e9f0baf6d3bd267ce71984a5981b131d11
|
|
| MD5 |
4daf8074ed2eaccd3150f49c8eec5367
|
|
| BLAKE2b-256 |
b55404179c82f5c244271e1eecc1e715c6134a5f0abb21d0c727383183e77612
|
Provenance
The following attestation bundles were made for mkdocs_bpmn_js-0.1.0.tar.gz:
Publisher:
publish.yml on madebyherzblut/mkdocs-bpmn-js
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_bpmn_js-0.1.0.tar.gz -
Subject digest:
0575ce1a94be640269c8d594dabf98e9f0baf6d3bd267ce71984a5981b131d11 - Sigstore transparency entry: 206676027
- Sigstore integration time:
-
Permalink:
madebyherzblut/mkdocs-bpmn-js@4909490bb65c62f11f2e773d904a70fbe22d9de2 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/madebyherzblut
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4909490bb65c62f11f2e773d904a70fbe22d9de2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mkdocs_bpmn_js-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mkdocs_bpmn_js-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dea1a14073022780c0fe76d7d1dea332da8f94ffaf16dcaaa8b4070939327e74
|
|
| MD5 |
9bc88f9580ac072004a331be2e8188ca
|
|
| BLAKE2b-256 |
e65f4494dd165430cb8fbcc9bc15887721851b943fff247a02d27d521fe53f6a
|
Provenance
The following attestation bundles were made for mkdocs_bpmn_js-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on madebyherzblut/mkdocs-bpmn-js
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_bpmn_js-0.1.0-py3-none-any.whl -
Subject digest:
dea1a14073022780c0fe76d7d1dea332da8f94ffaf16dcaaa8b4070939327e74 - Sigstore transparency entry: 206676028
- Sigstore integration time:
-
Permalink:
madebyherzblut/mkdocs-bpmn-js@4909490bb65c62f11f2e773d904a70fbe22d9de2 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/madebyherzblut
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4909490bb65c62f11f2e773d904a70fbe22d9de2 -
Trigger Event:
release
-
Statement type: