Bugfix special characters of md_mermaid, because the dev doesn't want to fix the bug.
Project description
md_mermaid
This is a fork that we had to make to publish ObsidianHTML without the bug in the original md_mermaid package. The rest of this readme comes from there.
mermaid extension for Python-Markdown to add support for mermaid graph inside markdown file
Installation
For pip
installation (only python version >=3.x) :
pip install markdown
pip install md-mermaid
Usage
In your python script :
import markdown
text = """
# Title
Some text.
~~~mermaid
graph TB
A --> B
B --> C
~~~
Some other text.
~~~mermaid
graph TB
D --> E
E --> F
~~~
"""
html = markdown.markdown(text, extensions=['md_mermaid'])
print(html)
Output will result in :
<h1>Title</h1>
<p>Some text.</p>
<div class="mermaid">
graph TB
A --> B
B --> C
</div>
<p>Some other text.</p>
<div class="mermaid">
graph TB
D --> E
E --> F
</div>
<script>mermaid.initialize({startOnLoad:true});</script>
The <script>...</script>
line appears only once even if there are several graphs in the file.
Note that the extension name have a '_' not a '-'.
Attention : don't forget to include in your output html project the two following mermaid files :
- mermaid.css (optional, can be customised)
- mermaid.min.js (can be download here here)
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
File details
Details for the file obsidianhtml_md_mermaid_fork-0.1.5.tar.gz
.
File metadata
- Download URL: obsidianhtml_md_mermaid_fork-0.1.5.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8efdbd64342dd7c7e2fe2d34e1bbec03064dd0203a0a6edb8ded6fdd6e26f6d |
|
MD5 | f9182e72d2aab8431ec9ed0404768f90 |
|
BLAKE2b-256 | 9dd99c12d6373f7df0f227b6afe20c719fec12a7b7846b0c10285c93b633bd86 |
File details
Details for the file obsidianhtml_md_mermaid_fork-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: obsidianhtml_md_mermaid_fork-0.1.5-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76525abdd2a9e105095fd8e150a0e249def0ff2f6bf3b3c2644d14e7739f6d43 |
|
MD5 | 3e595e1c7f8991444a77bd518f5a5f9d |
|
BLAKE2b-256 | f389fc2a8af40cd4cb7dc90e41818a831b9e2185b71988b544ee1769f3c5cfd8 |