← 返回
未分类 中文

pretty-mermaid

Generate beautiful Mermaid.js diagrams with custom styling and themes. Create flowcharts, sequence diagrams, Gantt charts, class diagrams, etc. with enhanced...
使用自定义样式和主题生成精美的 Mermaid.js 图表。创建流程图、时序图、甘特图、类图等,支持增强功能。
caowen2211891 caowen2211891 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 516
下载
💾 6
安装
1
版本
#latest

概述

Follow these steps to create beautiful Mermaid diagrams with custom styling.

1) Check Dependencies

This skill uses Mermaid.js and optionally Puppeteer for image generation.

# Install Node.js packages if needed
npm install -g @mermaid-js/mermaid-cli

2) Basic Diagram Generation

Create a simple Mermaid diagram:

# Create a basic flowchart
cat > diagram.mmd << 'EOF'
flowchart TD
    A[Start] --> B{Decision}
    B -->|Yes| C[Action 1]
    B -->|No| D[Action 2]
    C --> E[End]
    D --> E
EOF

# Generate PNG
mmdc -i diagram.mmd -o diagram.png

3) Using Bundled Scripts

Use the bundled Python script for enhanced diagram generation:

python3 skills/pretty-mermaid/scripts/mermaid-gen.py --help

Quick examples:

# Generate a flowchart with theme
python3 skills/pretty-mermaid/scripts/mermaid-gen.py --type flowchart --output flowchart.png --theme forest

# Generate a sequence diagram
python3 skills/pretty-mermaid/scripts/mermaid-gen.py --type sequence --output sequence.png --theme dark

# Generate a Gantt chart
python3 skills/pretty-mermaid/scripts/mermaid-gen.py --type gantt --output gantt.png --theme neutral

# Generate a class diagram
python3 skills/pretty-mermaid/scripts/mermaid-gen.py --type class --output class.png --theme default

4) Custom Styling Options

The script supports:

  • Themes: default, forest, dark, neutral
  • Background colors: Custom background colors
  • Font styles: Custom font families and sizes
  • Node styling: Custom shapes, colors, borders
  • Edge styling: Custom line styles, colors, widths

Example with custom styling:

python3 skills/pretty-mermaid/scripts/mermaid-gen.py \
  --type flowchart \
  --output custom.png \
  --theme custom \
  --background "#f8f9fa" \
  --font-family "Arial, sans-serif" \
  --node-color "#1a73e8" \
  --edge-color "#5f6368"

5) Diagram Types Supported

  1. Flowchart: Flow diagrams, process flows
  2. Sequence: Sequence diagrams, UML sequence
  3. Gantt: Gantt charts, project timelines
  4. Class: Class diagrams, UML class
  5. State: State diagrams, state machines
  6. Entity Relationship: ER diagrams
  7. User Journey: User journey maps
  8. Pie: Pie charts
  9. Quadrant: Quadrant charts
  10. Requirement: Requirement diagrams

6) Advanced Features

  • Interactive diagrams: Generate HTML with interactive elements
  • Multiple outputs: Generate PNG, SVG, PDF, HTML from same source
  • Template system: Use predefined templates for common diagrams
  • Auto-layout: Automatic layout optimization
  • Export options: Multiple export formats and resolutions

7) Using mermaid-cli Directly

For advanced usage, use mermaid-cli directly:

# Generate SVG
mmdc -i input.mmd -o output.svg -t forest -b transparent

# Generate PDF
mmdc -i input.mmd -o output.pdf -t dark

# Generate with custom CSS
mmdc -i input.mmd -o output.png -C custom.css

8) Templates and Examples

Check the examples/ directory for:

  • Common diagram templates
  • Styling examples
  • Configuration files
  • Sample outputs

9) Quick Reference

  • Default theme: default
  • Default format: PNG
  • Default size: 800x600
  • Auto-scaling: Enabled by default
  • Background: White (#ffffff)
  • Font: Arial, sans-serif

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 19:54 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 42,170
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 198 📥 68,305
dev-programming

Docker Essentials

arnarsson
核心 Docker 命令和工作流程,包括容器管理、镜像操作和调试。
★ 38 📥 32,719