返回顶部
m

mermaid-image-export

Mermaid diagram image export using mermaid-cli. When Claude needs to export Mermaid diagrams as high-quality images (PNG, SVG, PDF) for documentation, presentations, print materials, or web embedding. Uses mermaid-cli with Puppeteer-based rendering for pixel-perfect outputs.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
66
下载量
0
收藏
概述
安装方式
版本历史

mermaid-image-export

# Mermaid CLI Image Export Skill Professional image export skill for Mermaid diagrams using mermaid-cli. Converts Mermaid code into high-quality PNG, SVG, and PDF images suitable for documentation, presentations, and print materials. ## Quick Start ### Prerequisites ```bash # Check if Node.js is installed node --version # Check if npm is installed npm --version ``` ### Installation Check ```bash python scripts/install_mermaid_cli.py --check ``` ### Basic Usage Export a Mermaid diagram to PNG: ```bash python scripts/export_mermaid_image.py diagram.mmd -o output.png ``` Export to SVG: ```bash python scripts/export_mermaid_image.py diagram.mmd -f svg -o diagram.svg ``` Batch export multiple files: ```bash python scripts/export_mermaid_image.py *.mmd -d outputs/ ``` ## Core Features ### Supported Formats - **PNG**: Raster image, ideal for web and documents - **SVG**: Vector image, scalable without quality loss - **PDF**: Document format for printing and sharing ### Quality Controls - Resolution scaling (`--scale`) - Background color (`--background`) - Width and height constraints (`--width`, `--height`) - Custom CSS styling (`--css`) ### Theme Support - All Mermaid built-in themes: `default`, `forest`, `dark`, `neutral` - Custom theme configuration (`--config`) - Dark/light mode switching ### Batch Processing - Export multiple diagrams at once - Progress tracking and error handling - Consistent settings across all exports ## Workflow ### 1. Environment Setup Ensure Node.js and mermaid-cli are installed: ```bash npm install -g @mermaid-js/mermaid-cli ``` ### 2. Diagram Creation Create Mermaid diagrams using standard syntax. ### 3. Image Export Use appropriate format based on needs: - **Web/Docs**: PNG or SVG - **Print**: PDF or high-resolution PNG - **Development**: Quick PNG previews ### 4. Integration Embed exported images in: - README documentation - Presentation slides - Technical papers - API documentation - Blog posts ## Comparison with Termaid | Feature | Termaid | Mermaid-CLI Export | |---------|---------|-------------------| | **Output** | ASCII terminal | PNG/SVG/PDF images | | **Dependencies** | Pure Python | Node.js + Puppeteer | | **Use Case** | Terminal preview | Professional export | | **Quality** | Terminal-friendly | Print-ready | | **Speed** | Instant | Requires browser | ## Advanced Usage ### Custom Configuration ```bash # Custom CSS python scripts/export_mermaid_image.py diagram.mmd --css custom.css -o output.png # Specific theme python scripts/export_mermaid_image.py diagram.mmd -t dark -o output.png # High resolution python scripts/export_mermaid_image.py diagram.mmd --scale 2.0 -o output.png ``` ### Automation ```bash # CI/CD integration python scripts/export_mermaid_image.py docs/*.mmd -d generated/ # Documentation generation find . -name "*.mmd" -exec python scripts/export_mermaid_image.py {} -o images/{}.png \; ``` ## Troubleshooting ### Common Issues 1. **Node.js not installed**: Install Node.js from nodejs.org 2. **mermaid-cli not found**: Run `npm install -g @mermaid-js/mermaid-cli` 3. **Browser errors**: Ensure Chrome/Chromium is installed 4. **Memory issues**: Reduce image size or resolution ### Performance Tips - Use lower resolution for quick previews - Cache frequently used diagrams - Batch process multiple diagrams - Consider using SVG for scalability ## Examples See `assets/examples/` for complete examples: - Basic export workflow - Configuration examples - Template diagrams ## References Complete documentation in `references/`: - `overview.md`: Skill overview - `installation.md`: Installation guide - `usage.md`: Usage instructions - `formats.md`: Format specifications - `troubleshooting.md`: Problem solving --- **Note**: This skill requires Node.js and mermaid-cli installation. For terminal-only rendering without dependencies, use the `termaid` skill.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 mermaid-image-export-1776025057 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 mermaid-image-export-1776025057 技能

通过命令行安装

skillhub install mermaid-image-export-1776025057

下载 Zip 包

⬇ 下载 mermaid-image-export v1.0.0

文件大小: 34.81 KB | 发布时间: 2026-4-13 11:01

v1.0.0 最新 2026-4-13 11:01
- Initial release of professional Mermaid diagram image export using mermaid-cli.
- Supports high-quality PNG, SVG, and PDF output suitable for docs, presentations, and print materials.
- Includes resolution scaling, background color, custom CSS, theme switching, and batch processing.
- Provides troubleshooting guidance and advanced usage examples.
- Compares features with terminal-only rendering tools for clarity.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部