https://github.com/deiv/markdown-it-markmap
markdown-it-markmap
https://github.com/deiv/markdown-it-markmap
markdown markdown-it markdown-it-plugin markmap mindmap
Last synced: 3 months ago
JSON representation
markdown-it-markmap
- Host: GitHub
- URL: https://github.com/deiv/markdown-it-markmap
- Owner: deiv
- License: mit
- Created: 2020-05-09T18:28:46.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-09T22:44:13.000Z (about 5 years ago)
- Last Synced: 2025-02-27T01:48:11.998Z (4 months ago)
- Topics: markdown, markdown-it, markdown-it-plugin, markmap, mindmap
- Language: JavaScript
- Size: 4.88 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# markdown-it-markmap
> Markmap plugin for markdown-it markdown parser.
With this plugin you can create mindmap using [markmap](https://markmap.js.org/).
It adds a named fence _mindmap_ to the markdown parser.
## Installation
```bash
$ yarn add https://github.com/deiv/markdown-it-markmap.git
```## Usage
Configure the plugin in markdown-it:
```js
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:
```html
const mindmaps = document.querySelectorAll('.markmap-svg');
for(const mindmap of mindmaps) {
markmap.markmap(mindmap, JSON.parse(mindmap.innerHTML));
}```
## Example
Markdown example:
```markdown
```mindmap
# root
## child1
- child3
## child2
- child3
```## License
[MIT](LICENSE)