Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
markmap-lib
Advanced tools
Visualize your Markdown as mindmaps.
This project is heavily inspired by Markmap.
See online demo.
Install globally:
$ yarn global add markmap-lib
# or
$ npm install markmap-lib -g
or use with npx
:
$ npx markmap-lib
Usage: markmap [options] <input>
Create a markmap from a Markdown input file
Options:
-V, --version output the version number
-o, --output <output> specify filename of the output HTML
--enable-mathjax enable MathJax support
--no-open do not open the output file after generation
-h, --help display help for command
Suppose you have a Markdown file named note.md
.
Run the following command to get an interactive mindmap:
$ markmap note.md
# without global installation
$ npx markmap-lib note.md
Then you will get a note.html
in the same directory, and hopefully it will be open in your default browser.
To enable MathJax support for your Markdown, pass --enable-mathjax
:
$ markmap --enable-mathjax note.md
$ yarn add markmap-lib
# or
$ npm install markmap-lib
Transform Markdown to markmap data:
import { transform } from 'markmap-lib/dist/transform.common';
const data = transform(markdown);
Now we get the data for rendering in data
.
Render a markmap from transformed data:
Create an SVG element with explicit width and height:
<svg id="markmap" style="width: 800px; height: 800px"></svg>
Render a markmap to the SVG element:
import { markmap } from 'markmap-lib/dist/view.common';
markmap('#markmap', data);
// or pass an SVG element directly
const svgEl = document.querySelector('#markmap');
markmap(svgEl, data);
To enable MathJax, you need to load MathJax before rendering markmap:
<script>
window.MathJax = {
options: {
skipHtmlTags: {
'[-]': ['code', 'pre']
}
}
};
</script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
and process Html with MathJax in options.processHtml
:
import { markmap } from 'markmap-lib/dist/view.common';
markmap('#markmap', data, {
processHtml: nodes => {
if (window.MathJax.typeset) MathJax.typeset(nodes);
},
});
Note:
skipHtmlTags
option is required because inline code generated from Markdown is always wrapped in <code>
, which is ignored by MathJax by default.options.processHtml
without a flash.FAQs
Visualize your Markdown as mindmaps with Markmap
The npm package markmap-lib receives a total of 3,224 weekly downloads. As such, markmap-lib popularity was classified as popular.
We found that markmap-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.