Mermaid图表渲染器Skill mermaid-renderer

Mermaid图表渲染器是一款将Mermaid文本定义转换为高质量图像(PNG/SVG/PDF)的工具,支持流程图、序列图、类图、ER图等多种图表类型,提供主题定制、背景设置和Markdown集成功能,适用于软件架构设计、文档生成和数据可视化场景。关键词:Mermaid图表渲染,流程图生成,架构图工具,文档自动化,数据可视化,主题定制,Puppeteer渲染。

架构设计 0 次安装 6 次浏览 更新于 2/26/2026

名称: mermaid-图表渲染器 描述: 通过主题定制和Markdown集成将Mermaid图表渲染为图像 允许使用的工具:

  • Bash
  • Read
  • Write
  • Glob

Mermaid 图表渲染器 技能

概述

将Mermaid图表定义渲染为图像,支持流程图、序列图、类图、ER图等,并提供主题定制功能。

功能

  • 将Mermaid图表渲染为PNG、SVG、PDF格式
  • 支持流程图、序列图、类图、ER图、甘特图、饼图、旅程图等
  • 主题定制(默认、暗黑、森林、中性)
  • 与Markdown文档集成
  • 背景颜色和样式选项
  • 基于Puppeteer的高质量渲染

目标流程

  • c4模型文档化
  • 微服务分解
  • 数据架构设计

输入模式

{
  "type": "object",
  "required": ["source"],
  "properties": {
    "source": {
      "type": "string",
      "description": "Mermaid图表定义"
    },
    "outputFormat": {
      "type": "string",
      "enum": ["png", "svg", "pdf"],
      "default": "svg"
    },
    "outputPath": {
      "type": "string",
      "description": "输出文件路径"
    },
    "theme": {
      "type": "string",
      "enum": ["default", "dark", "forest", "neutral"],
      "default": "default"
    },
    "config": {
      "type": "object",
      "properties": {
        "backgroundColor": {
          "type": "string",
          "default": "white"
        },
        "width": {
          "type": "number"
        },
        "height": {
          "type": "number"
        }
      }
    }
  }
}

输出模式

{
  "type": "object",
  "properties": {
    "outputPath": {
      "type": "string",
      "description": "渲染后图像的路径"
    },
    "format": {
      "type": "string"
    },
    "dimensions": {
      "type": "object",
      "properties": {
        "width": { "type": "number" },
        "height": { "type": "number" }
      }
    }
  }
}

使用示例

{
  kind: 'skill',
  skill: {
    name: 'mermaid-renderer',
    context: {
      source: 'graph TD
  A[开始] --> B[处理]
  B --> C[结束]',
      outputFormat: 'svg',
      outputPath: 'docs/diagrams/flow.svg',
      theme: 'default'
    }
  }
}