0.2.0 • Published 8 years ago

pandoc-mermaid-filter v0.2.0

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

pandoc-mermaid-filter

pandoc-mermaid-filter is mermaid filter for pandoc.

Tested on pandoc 1.16.0.2 and Node.js v5.5.0.

Feature

Input markdown
Output HTML
<div>
<!-- htmlmin:ignore -->
<div class="mermaid">
graph TD;
    A--&gt;B;
    A--&gt;C;
    B--&gt;D;
    C--&gt;D;
</div>
<!-- htmlmin:ignore -->
</div>

pandoc escaped > to &gt; but no problem.

<!-- htmlmin:ignore --> prevent that HTMLMinifier remove the whitespaces.

Usage

Export and edit template
$ pandoc -D html5 > template.html
<link rel="stylesheet" href="css/mermaid.min.css">
<script src="js/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad:true});</script>
Global install with npm
$ npm install --global git+https://github.com/nishimaki10/pandoc-mermaid-filter.git

Executable filename is pandoc-mermaid.

Run
$ pandoc -f markdown -t html5 -F pandoc-mermaid --template=template.html -o output.html input.md