Render stunning, professionally-styled Mermaid diagrams with one command. Supports SVG for web/docs and ASCII for terminals. **From a file:** ```
node scripts/render.mjs \ --input diagram.mmd \ --output diagram.svg \ --format svg \ --theme tokyo-night
.mmd filenode scripts/batch.mjs \ --input-dir ./diagrams \ --output-dir ./output \ --format svg \ --theme dracula \ --workers 4 `### ASCII Output (Terminal-Friendly)` node scripts/render.mjs \ --input diagram.mmd \ --format ascii \ --use-ascii
--format svg--format asciitokyo-night (recommended)github-lightdraculanode scripts/themes.mjs.mmd file or Mermaid code block:cat > diagram.mmd << 'EOF' flowchart LR A[Start] --> B[End] EOF `2. **Render with theme**:` node scripts/render.mjs \ --input diagram.mmd \ --output diagram.svg \ --theme tokyo-night
--format svg --output diagram.svg--format ascii (prints to stdout)--use-ascii - Use pure ASCII (no Unicode)--padding-x 5 - Horizontal spacing--padding-y 5 - Vertical spacingnode scripts/render.mjs \ --input diagram.mmd \ --bg "#1a1b26" \ --fg "#a9b1d6" \ --accent "#7aa2f7" \ --output custom.svg `**Transparent Background**:` node scripts/render.mjs \ --input diagram.mmd \ --transparent \ --output transparent.svg `**Custom Font**:` node scripts/render.mjs \ --input diagram.mmd \ --font "JetBrains Mono" \ --output custom-font.svg
ls assets/example_diagrams/ # flowchart.mmd sequence.mmd state.mmd class.mmd er.mmd `**Step 2: Copy and modify**` cp assets/example_diagrams/flowchart.mmd my-workflow.mmd # Edit my-workflow.mmd with user requirements `**Step 3: Render**` node scripts/render.mjs \ --input my-workflow.mmd \ --output my-workflow.svg \ --theme github-dark
flowchart LR A[Start] --> B{Decision} B -->|Yes| C[Action] B -->|No| D[End] `**Sequence** - API calls, interactions, message flows` sequenceDiagram User->>Server: Request Server-->>User: Response `**State** - Application states, lifecycle, FSM` stateDiagram-v2 [*] --> Idle Idle --> Loading Loading --> [*] `**Class** - Object models, architecture, relationships` classDiagram User --> Post: creates Post --> Comment: has `**ER** - Database schema, data models` erDiagram USER ||--o{ ORDER : places ORDER ||--|{ ORDER_ITEM : contains
cat > user-diagram.mmd << 'EOF' # [Insert generated Mermaid code] EOF `**Step 3: Render and iterate**` node scripts/render.mjs \ --input user-diagram.mmd \ --output preview.svg \ --theme tokyo-night # Review with user, edit diagram.mmd if needed, re-render
node scripts/themes.mjsAvailable Beautiful-Mermaid Themes: 1. zinc-light 2. zinc-dark 3. tokyo-night 4. tokyo-night-storm 5. tokyo-night-light 6. catppuccin-mocha 7. catppuccin-latte 8. nord 9. nord-light 10. dracula 11. github-dark 12. github-light 13. solarized-dark 14. solarized-light 15. one-dark Total: 15 themes
tokyo-night ⭐ - Modern, developer-friendlygithub-dark - Familiar GitHub styledracula - Vibrant, high contrastnord - Cool, minimalistgithub-light - Clean, professionalzinc-light - High contrast, printablecatppuccin-latte - Warm, friendlynode scripts/render.mjs \ --input diagram.mmd \ --output themed.svg \ --theme tokyo-night
for theme in tokyo-night dracula github-dark; do node scripts/render.mjs \ --input diagram.mmd \ --output "diagram-${theme}.svg" \ --theme "$theme" done
diagrams/ ├── architecture.mmd ├── workflow.mmd └── database.mmd `**Step 2: Batch render**` node scripts/batch.mjs \ --input-dir ./diagrams \ --output-dir ./rendered \ --format svg \ --theme tokyo-night \ --workers 4 `**Output:**` Found 3 diagram(s) to render... ✓ architecture.mmd ✓ workflow.mmd ✓ database.mmd 3/3 diagrams rendered successfully
# SVG for docs node scripts/batch.mjs \ --input-dir ./diagrams \ --output-dir ./svg \ --format svg \ --theme github-dark # ASCII for README node scripts/batch.mjs \ --input-dir ./diagrams \ --output-dir ./ascii \ --format ascii \ --use-ascii
--workers N - Parallel rendering (default: 4)--workers 8 for 10+ diagrams# User provides architecture description # → Create flowchart.mmd # → Render with professional theme node scripts/render.mjs \ --input architecture.mmd \ --output docs/architecture.svg \ --theme github-dark \ --transparent `### 2\. API Sequence Diagram` # User describes API flow # → Create sequence.mmd # → Render with clear theme node scripts/render.mjs \ --input api-flow.mmd \ --output api-sequence.svg \ --theme tokyo-night `### 3\. Database Schema Visualization` # User provides table definitions # → Create er.mmd # → Render for database docs node scripts/render.mjs \ --input schema.mmd \ --output database-schema.svg \ --theme dracula `### 4\. Terminal-Friendly Workflow` # For README or terminal display node scripts/render.mjs \ --input workflow.mmd \ --format ascii \ --use-ascii > workflow.txt `### 5\. Presentation Slides` # High-contrast for projectors node scripts/render.mjs \ --input slides-diagram.mmd \ --output presentation.svg \ --theme zinc-light
Error: Cannot find module 'beautiful-mermaid'cd /path/to/pretty-mermaid-skill && npm installError: Parse error on line 3A --> BError: Input file not found: diagram.mmdrender.mjs - Main rendering scriptbatch.mjs - Batch processing scriptthemes.mjs - Theme listing utilityTHEMES.md - Detailed theme reference with examplesDIAGRAM_TYPES.md - Comprehensive syntax guide for all diagram typesapi_reference.md - beautiful-mermaid API documentationexample_diagrams/flowchart.mmd - Flowchart templateexample_diagrams/sequence.mmd - Sequence diagram templateexample_diagrams/state.mmd - State diagram templateexample_diagrams/class.mmd - Class diagram templateexample_diagrams/er.mmd - ER diagram templatetokyo-night or github-dark for technical docs--transparentassets/example_diagrams/