feat: mermaid support for markdown

This commit is contained in:
NGPixel
2020-03-29 20:54:39 -04:00
parent 951ebb6b61
commit 1d16a3fc71
5 changed files with 163 additions and 3 deletions

View File

@@ -249,6 +249,7 @@
<script>
import { StatusIndicator } from 'vue-status-indicator'
import Prism from 'prismjs'
import mermaid from 'mermaid'
import { get } from 'vuex-pathify'
import _ from 'lodash'
import ClipboardJS from 'clipboard'
@@ -432,6 +433,12 @@ export default {
// -> Highlight Code Blocks
Prism.highlightAllUnder(this.$refs.container)
// -> Render Mermaid diagrams
mermaid.mermaidAPI.initialize({
startOnLoad: true,
theme: this.$vuetify.theme.dark ? `dark` : `default`
})
// -> Handle anchor scrolling
this.$nextTick(() => {
if (window.location.hash && window.location.hash.length > 1) {