added mermaid support in md
This commit is contained in:
parent
fc383a24fe
commit
6c1f296147
@ -19,8 +19,34 @@ test
|
||||
|
||||
{% end %}
|
||||
|
||||
## My example mermaid diagram
|
||||
|
||||
I wanted to use mermaid in this project, and it looks like this
|
||||
{% mermaid() %}
|
||||
|
||||
classDiagram
|
||||
Animal <|-- Duck
|
||||
Animal <|-- Fish
|
||||
Animal <|-- Zebra
|
||||
Animal : +int age
|
||||
Animal : +String gender
|
||||
Animal: +isMammal()
|
||||
Animal: +mate()
|
||||
class Duck{
|
||||
+String beakColor
|
||||
+swim()
|
||||
+quack()
|
||||
}
|
||||
class Fish{
|
||||
-int sizeInFeet
|
||||
-canEat()
|
||||
}
|
||||
class Zebra{
|
||||
+bool is_wild
|
||||
+run()
|
||||
}
|
||||
|
||||
{% end %}
|
||||
|
||||
{% row() %}
|
||||
|
||||
@ -44,6 +70,4 @@ Finally a framework fun to be used.
|
||||
- something
|
||||
- test3
|
||||
|
||||
|
||||
|
||||
{% end %}
|
||||
|
@ -2,6 +2,9 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
<main class="pt-16">
|
||||
<main class="p-16">
|
||||
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
||||
<script>mermaid.initialize({startOnLoad:true});</script>
|
||||
{{page.content | safe}}
|
||||
|
||||
</main> {% endblock content %}
|
||||
|
3
templates/shortcodes/mermaid.html
Normal file
3
templates/shortcodes/mermaid.html
Normal file
@ -0,0 +1,3 @@
|
||||
<div class="mermaid">
|
||||
{{ body }}
|
||||
</div>
|
Reference in New Issue
Block a user