Closed mcdoyaji closed 5 years ago
Load mermaid before new Docute
OK. there's no index.html so I use javascript native way. ref here
window.mermaid = require('mermaid');
I'm not sure this is proper way. some hard-coded...
Anyway. Anybody like me follow below way.
yarn add docute-mermaid
yarn add mermaid
\website\index.js
file.......
import docuteMermaid from 'docute-mermaid'
// add mermaid before docute-mermaid plugins loaded
window.mermaid = require('mermaid');
new Docute({
target: 'app',
title: 'Docute',
layout: 'wide',
highlight: ['typescript', 'bash', 'json', 'markdown'],
plugins: [
// then apply docute-mermaid plugin
docuteMermaid()
].filter(Boolean),
I Got error like below :
I load plugin And scripts like below :
yarn add docute-mermaid
https://github.com/baram204/vue-typescript-excer/blob/master/website/index.js
https://github.com/baram204/vue-typescript-excer/blob/master/src/views/Home.vue
All scripts loaded dom.
But mermaid works like normal fenced code.
So What Should I do If I want to display mermaid code properly??