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
Hashes for obsidianhtml_md_mermaid_fork-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9693279228667913348529dbcb991cf4683a8d398cffbd9e964d23c51ae239d3 |
|
MD5 | 9571cdddeacf7c826260aa18ade1786d |
|
BLAKE2b-256 | 24995643488b37b2da352fe2bf807d222a022b2382a324662ac9bc1334e7390b |
Hashes for obsidianhtml_md_mermaid_fork-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc51e90abb715898632065245f13421714368a7d9ef0e845174d701661ba0fd9 |
|
MD5 | 4d91f9cc7d16ae2759c585c4272672b7 |
|
BLAKE2b-256 | 207cab9ac7e76d7213c17b13fea2a20b9c5d305b34b661e2a57da8e8c734a19b |