Closed mythsman closed 5 years ago
@mythsman IMHO, we will not implement mermaid.js support. Because, markdown-it plugins not supported mermaid.js
If you want to use mermaid.js you should implement it by customizing your theme. I wrote an example below.
Please add below code in your theme.
<% if (post.enableMermaidjs) { %>
<script async src="https://unpkg.com/mermaid@8.0.0-rc.8/dist/mermaid.min.js"></script>
<script>
window.onload = function () {
mermaid.initialize({startOnLoad:true});
};
</script>
<% } %>
Hexo can define a variable to each post.
Please add enableMermaidjs
front-matter to you post which you want to use mermaid.js.
---
title: Hello World
date: 2013/7/13 20:46:25
enableMermaidjs: true // you can define original variable to each post
---
You can control which post to use mermaid.js if you implement above code.
@YoshinoriN Thank you for your suggestion which helps me a lot :smile:
I think it would be better if hexo-render-markdown-it can support mermaid language to help us draw diagrams.
Or , is there any other way for me to use mermaid in my article gracefully ?
Thank you!