Browserless server-side Mermaid renderer for Hexo, powered by Merman.
The plugin replaces Mermaid source blocks with inline SVG during hexo generate. It does not launch Chromium or ship client-side Mermaid JavaScript.
npm install hexo-filter-merman
hexo cleanThe following HTML forms are supported:
<pre><code class="mermaid">flowchart TD
A --> B
</code></pre>
<pre><code class="language-mermaid">flowchart TD
A --> B
</code></pre>NexT's {% mermaid %} tag emits the first form and works without further changes.
Standard Mermaid fences are supported too:
```mermaid
flowchart TD
A --> B
```To keep Hexo's syntax highlighter from consuming fenced diagrams first, exclude mermaid in the site _config.yml:
highlight:
line_number: true
auto_detect: false
tab_replace: ''
wrap: true
exclude_languages:
- mermaidSites using Prism should add the same entry under prismjs.exclude_languages instead.
Rendering is enabled by default. Merman binding options can be passed through without translation:
merman:
enable: true
options:
site_config:
theme: neutral
flowchart:
curve: linear
svg:
pipeline: readableThe plugin assigns a stable, unique svg.diagram_id to every diagram. A configured diagram_id is therefore ignored.
See Merman's SvgBindingOptions for the complete options surface.
Merman SVGs contain scoped inline CSS. If a theme derives the page description directly from post HTML, put an explicit description in the post front matter to keep SVG styles out of generated metadata.
Released under the MIT License.