2.5k
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
3 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill openclaw/skills --skill mermaid-image-generator- _meta.json302 B
- SKILL.md4.6 KB
Overview
This skill converts Mermaid diagram syntax into PNG or SVG images using the mermaid.ink rendering API. It requires no external Node.js dependencies and works in headless or minimal environments via built-in Node.js modules and curl. Use it to create sharable diagram images for presentations, documentation, or web content quickly and reliably.
How this skill works
The script accepts Mermaid code from a file path or stdin, base64-encodes the diagram text, and calls mermaid.ink endpoints to retrieve a PNG or SVG image. Output format is chosen by the output file extension (.png or .svg). The tool handles common errors (missing files, API failures, timeouts) and will create output directories as needed.
When to use it
- Convert Mermaid .mmd files to PNG or SVG for slides, docs, or reports
- Generate diagram images from piped Mermaid code (stdin) in scripts or CI
- Create quick visuals when local Mermaid CLI or headless Chrome is unavailable
- Produce SVGs for web/docs and PNGs for presentation compatibility
- Share diagrams as images without installing extra dependencies
Best practices
- Validate Mermaid syntax at mermaid.live before rendering to avoid API errors
- Keep diagrams simple (fewer than ~15 nodes) for readability and layout stability
- Use meaningful labels and comments (%%) to make diagrams self-documenting
- Choose SVG for scalable graphics and PNG for slide compatibility
- Avoid embedding sensitive data; diagram text is sent to an external service
Example use cases
- Convert a saved diagram file: node scripts/mermaid-to-image.js diagram.mmd diagram.png
- Pipe Mermaid code from a tool or CI job into the converter for automated image generation
- Produce SVG architecture diagrams for documentation sites
- Generate PNG flowcharts for PowerPoint slides or offline presentations
- Quickly share sequence diagrams or class diagrams as images in chat or email
FAQ
No. The script uses only Node.js built-ins and curl to call the mermaid.ink API, so there are no additional local dependencies.
Can I render diagrams offline or with sensitive content?
No. Rendering happens on mermaid.ink, so an internet connection is required. Do not send sensitive data; use a local Mermaid CLI for private content.