Skip to content

refmdio/mermaid-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mermaid Plugin

Mermaid Plugin renders Markdown ```mermaid code fences inside RefMD documents. The server keeps the original HTML placeholder, while the client-side hydrator upgrades it to an interactive SVG using Mermaid’s ESM runtime.

Features

  • Server-side placeholders for mermaid code fences
  • Client hydrator that loads Mermaid from CDN or a custom runtime
  • Optional runtime override via the Markdown feature flag mermaid:runtime=<url>

Install in RefMD

  1. Download the packaged archive from https://github.com/refmdio/mermaid-plugin/releases/download/<tag>/mermaid-plugin.zip
  2. In RefMD open Plugins → Install from URL and paste the link.
  3. Render any ```mermaid block to see server-rendered SVG that hydrates on load.

Build Locally

cargo build --release --target wasm32-wasip1 --manifest-path backend/Cargo.toml
cp backend/target/wasm32-wasip1/release/mermaid_plugin_backend.wasm backend/plugin.wasm
zip -r mermaid-plugin.zip plugin.json assets backend/plugin.wasm

Install the resulting mermaid-plugin.zip through RefMD’s plugin manager.

Package Contents

mermaid-plugin/
├─ backend/plugin.wasm
├─ assets/mermaid-hydrate.js
└─ plugin.json

The manifest declares a single renderer for kind mermaid, a WASM backend entry point render, and a hydrator module exported from assets/mermaid-hydrate.js.

About

Mermaid.js rendering plugin for RefMD

Resources

Stars

Watchers

Forks

Packages

No packages published