render_mermaid
Render Mermaid diagrams to SVG, PNG, JPG, or PDF formats with custom styling and output as a URL, saved file, or raw data.
Instructions
Render a Mermaid diagram to SVG, PNG, JPG, or PDF format with comprehensive styling and output options. Output options:
"link" (default): Returns a localhost URL for easy viewing (always show the user the link he can view the diagram in a browser)
"filepath": Saves to disk and returns the file path
"raw": Returns base64 data for images or raw SVG string
Examples:
Basic SVG: Just provide mermaidCode for raw SVG data
Localhost image: Set format='png' with output='link' (default) to get a localhost URL
Save to disk: Set output='filepath' to save and get file path
Base64 image: Set output='raw' to get base64 data for tags
Custom styling: Use theme, backgroundColor, and dimension options for tailored appearance
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| theme | No | default | |
| width | No | ||
| format | No | svg | |
| height | No | ||
| output | No | link | |
| quality | No | ||
| darkMode | No | ||
| filePath | No | ||
| fontSize | No | ||
| sequence | No | ||
| flowchart | No | ||
| fontFamily | No | ||
| htmlLabels | No | ||
| maxTextSize | No | ||
| mermaidCode | Yes | ||
| backgroundColor | No |