Loading...
Loading...
Convert Mermaid code blocks in .mmd or .md files to animated GIFs with customizable animation styles (progressive, highlight walk, pulse flow, wave).
npx skill4agent add zc277584121/marketing-skills mermaid-to-gif.mmd```mermaid.mdPrerequisites: FFmpeg, Python 3.8+, Playwright ()pip install playwright && playwright install chromium
.mmd.md.md| Context Clue | Recommended Style | Reasoning |
|---|---|---|
| Data pipeline, ETL flow, request/response path | | Flowing dashed lines convey data movement |
| Architecture layers, org chart, hierarchy | | Elements activate layer-by-layer |
| Step-by-step process, tutorial walkthrough | | Spotlight guides the reader through each step |
| System overview, title diagram, simple reference | | Brightness ripple adds life without distraction |
| Sequence diagram with message flow | | Messages activate one by one in conversation order |
| Class/ER diagram (reference/static) | | Structure lights up or gets a subtle ripple |
pulse-flowprogressivewavewave--duration.md## Data Ingestion Pipeline ← context: "pipeline" → pulse-flow
[mermaid block: graph LR with ETL stages]
## System Architecture ← context: "architecture" → progressive
[mermaid block: graph TD with layers]
## Quick Reference ← context: "reference" → wave
[mermaid block: simple diagram]python ${CLAUDE_SKILL_ROOT}/scripts/mermaid_to_gif.py diagram.mmdpython ${CLAUDE_SKILL_ROOT}/scripts/mermaid_to_gif.py document.md -o ./images/```mermaidpython ${CLAUDE_SKILL_ROOT}/scripts/mermaid_to_gif.py *.mmd -o ./gifs/
python ${CLAUDE_SKILL_ROOT}/scripts/mermaid_to_gif.py doc1.md doc2.md -o ./gifs/```mermaid| Style | Effect | Best For |
|---|---|---|
| All elements start dimmed (25% opacity), activate sequentially to full brightness; edges draw in with stroke animation | Flowcharts, architecture, hierarchy |
| All elements start dimmed (15%); a spotlight with blue glow moves through each element, leaving visited ones bright | Step-by-step process, tutorials |
| All elements fully visible; edges become flowing dashed lines (uniform dash size and speed) | Data flow, pipelines, request paths |
| All elements fully visible; a brightness pulse + blue glow ripple sweeps through elements sequentially | Simple diagrams, overviews, reference |
| Flag | Default | Description |
|---|---|---|
| Same as input | Output directory for generated GIFs |
| | Animation style (see table above) |
| | Frames per second |
| | Animation duration in seconds |
| | Hold last frame before looping (seconds) |
| | Mermaid theme: default, dark, forest, neutral |
| | Background color (hex) |
| | Padding around diagram in pixels |
| | Render scale factor (2 = retina quality) |
| — | Path to custom CSS file |
| — | Play GIF once instead of looping |
# Dark theme with faster animation
python ${CLAUDE_SKILL_ROOT}/scripts/mermaid_to_gif.py arch.mmd --theme dark --bg "#1a1a2e" --duration 3
# High FPS for smoother animation
python ${CLAUDE_SKILL_ROOT}/scripts/mermaid_to_gif.py flow.mmd --fps 15 --duration 5
# Batch convert all mermaid blocks from a doc
python ${CLAUDE_SKILL_ROOT}/scripts/mermaid_to_gif.py README.md -o ./images/
# Custom CSS for special effects
python ${CLAUDE_SKILL_ROOT}/scripts/mermaid_to_gif.py diagram.mmd --custom-css my-style.css
# No loop, suitable for one-time playback
python ${CLAUDE_SKILL_ROOT}/scripts/mermaid_to_gif.py intro.mmd --no-loop --duration 6
# Lower resolution for smaller file size
python ${CLAUDE_SKILL_ROOT}/scripts/mermaid_to_gif.py diagram.mmd --scale 1/* Rounded nodes with shadow */
.node rect {
rx: 10;
filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}
/* Thicker edge lines */
.edgePath path {
stroke-width: 2.5;
}
/* Custom background for actors (sequence diagram) */
.actor {
fill: #e8f4f8;
}--custom-csspython ${CLAUDE_SKILL_ROOT}/scripts/mermaid_to_gif.py diagram.mmd --custom-css my-style.css.mmd.mdsetProgress(t)--scale 1--scale 1wave