added mermaid support in md

This commit is contained in:
timurgordon 2022-02-24 14:31:10 +03:00
parent fc383a24fe
commit 6c1f296147
3 changed files with 34 additions and 4 deletions

View File

@ -19,8 +19,34 @@ test
{% end %} {% 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() %} {% row() %}
@ -41,9 +67,7 @@ Finally a framework fun to be used.
- test - test
- test2 - test2
- internet - internet
- something - something
- test3 - test3
{% end %} {% end %}

View File

@ -2,6 +2,9 @@
{% block content %} {% 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}} {{page.content | safe}}
</main> {% endblock content %} </main> {% endblock content %}

View File

@ -0,0 +1,3 @@
<div class="mermaid">
{{ body }}
</div>