convert_diagram
Make Mermaid diagrams portable. Takes HTML containing blocks (or a raw Mermaid source) and returns the same document with every diagram pre-rendered to inline SVG and the Mermaid CDN runtime stripped. A CDN-backed diagram only renders if the reader can fetch and run the runtime; inline SVG needs neither, so the output survives offline readers, email clients, Notion/Confluence (which strip ), and PDF export. Rendering happens on our infrastructure; diagram content is not sent to any third party.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | HTML document or fragment containing <div class="mermaid"> blocks. Mutually exclusive with mermaid_source. | |
| theme | No | Mermaid theme. Default "default". | |
| background | No | "transparent" (default), "white", or a hex color. | |
| output_format | No | Default "html". "svg" returns the raw inline SVG and requires mermaid_source. | |
| mermaid_source | No | A single raw Mermaid diagram source. Mutually exclusive with html. | |
| inject_lightbox | No | Add click-to-enlarge overlay CSS+JS for small-text diagrams. Default false. |