New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Convert Mermaid code blocks in Markdown and other text files into PNG images via the mermaid.ink API.

skills.sh installs
4K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers the full conversion flow: scan target files, choose an output directory, render each block, and swap blocks for image references
  • Includes a Python render_mermaid helper that base64-encodes each diagram and requests a white-background PNG from mermaid.ink
  • Enforces a User-Agent header on requests, because mermaid.ink returns 403 without it, and descriptive filenames over generic names
  • Designed for publishing targets that cannot render Mermaid natively, such as GitHub Pages/Jekyll and Dev.to

Install

$ npx -y skills add zc277584121/marketing-skills --skill mermaid-to-image -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Skill: Mermaid to Image

Convert ```mermaid code blocks in Markdown (or other text) files into PNG images, and replace the code blocks with image references. Useful for platforms that don't render Mermaid natively (GitHub Pages/Jekyll, Dev.to, etc.).


When to Use

  • The user asks to convert Mermaid diagrams in a file to images
  • The user wants to render specific Mermaid code blocks as PNG
  • A publishing workflow requires static images instead of Mermaid code blocks

Workflow

Step 1: Identify target files

The user may specify:

  • A single file: convert mermaid blocks in docs/architecture.md
  • Multiple files: convert mermaid in all files under docs/
  • A specific code block: convert the second mermaid block in README.md

Scan the target file(s) for ```mermaid code blocks. Report how many blocks were found and in which files before proceeding.

Step 2: Determine the image output directory

Check the project structure to find where images are typically stored:

# Look for common image directories
ls -d images/ img/ assets/ assets/images/ static/images/ docs/images/ 2>/dev/null

Details

Repository
github.com/zc277584121/marketing-skills
Category
Technical Documentation
First seen
May 16, 2026

More from zc277584121/marketing-skills

All 14

Similar to Mermaid To Image

More Technical Documentation