Markmap plugin for markdown-it markdown parser.
With this plugin you can create mindmap using markmap.
It adds a named fence mindmap to the markdown parser.
$ yarn add https://github.com/deiv/markdown-it-markmap.git
Configure the plugin in markdown-it:
var markdownIt = require('markdown-it');
var markdownItMarkmap = require('../build/index');
const mdi = markdownIt();
mdi.use(markdownItMarkmap);
let mindmapContent = `
\`\`\`mindmap
# root
## child1
- child3
## child2
- child3
\`\`\``;
console.log(mdi.render(mindmapContent));
Add needed libraries in browser:
<script src="https://cdn.jsdelivr.net/npm/d3@5"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/browser/view.min.js"></script>
<script>
const mindmaps = document.querySelectorAll('.markmap-svg');
for(const mindmap of mindmaps) {
markmap.markmap(mindmap, JSON.parse(mindmap.innerHTML));
}
</script>
Markdown example:
```mindmap
# root
## child1
- child3
## child2
- child3