Diagram To Image

When a Mermaid diagram needs to be shared as an image → render to PNG/SVG.

cklxx Updated 11 repo stars
elephant.ai banner

File contents

diagram-to-image

Render Mermaid code into image files.

Requirements

  • mmdc (Mermaid CLI) installed and in PATH.
  • Install command: npm install -g @mermaid-js/mermaid-cli

Constraints

  • action=render only.
  • Input field is code (Mermaid source).
  • Supported output formats: png (default), svg.
  • Render timeout: 30s.
  • Default output path: /tmp/diagram_<ts>.<format>.

Usage

python3 skills/diagram-to-image/run.py render --code 'graph LR
A[Client] --> B[API]
B --> C[(DB)]' --format png --theme default --output /tmp/diagram_arch.png

cklxx/elephant.ai commit d5c2ae26a1

Frequently asked questions

npx get-skill add cklxx/diagram-to-image