Skip to content
Back to skills

Mermaid Image Uploader

ASecurity

Mermaid Image Uploader

  • 33 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 5, 2026
toolspythonbashnodeapi

Works with

  • cli
  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 7 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add dvcrn/openclaw-skills-marketplace --skill mermaid-image-uploader --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mermaid Image Uploader?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mermaid Image Uploader
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dvcrn-mermaid-image-uploader/badge)](https://www.skillsdirectory.com/skills/dvcrn-mermaid-image-uploader)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mermaid-image-uploader
description: "Mermaid Image Uploader"
---

# Mermaid 图片生成与图床上传技能

将 Mermaid 图表转换为图片并上传到免费图床,专为公众号文章设计。

## 功能特性

- 🎨 将 Mermaid 代码转换为高质量图片
- ☁️ 支持多个免费图床上传
- 🔗 自动返回图片 URL
- 📝 批量处理 Markdown 文件中的 Mermaid 图表
- 🖼️ 支持多种图片格式 (PNG, SVG, JPG)

## 快速开始

### 安装依赖

```bash
pip install mermaid-cli requests
```

或者安装 Node.js 的 mermaid-cli:

```bash
npm install -g @mermaid-js/mermaid-cli
```

### 使用方法

```bash
# 转换单个 Mermaid 文件
python mermaid_uploader.py --input diagram.mmd --output diagram.png

# 转换 Markdown 文件中的所有 Mermaid 图表
python mermaid_uploader.py --markdown article.md --upload

# 指定图床
python mermaid_uploader.py --input diagram.mmd --image-host imgur
```

## 支持的图床

| 图床 | 需要API Key | 特点 |
|------|------------|------|
| Imgur | ✅ | 稳定,国外 |
| FreeImage.host | ❌ | 免费,国内访问快 |
| Postimages | ❌ | 简单易用 |
| Cloudinary | ✅ | 功能强大 |

## 文件结构

```
skills/mermaid-image-uploader/
├── SKILL.md                    # 本文件
├── package.json                # 技能配置
├── README.md                   # 详细说明
├── mermaid_uploader.py         # 主程序
├── mermaid_converter.py        # Mermaid 转换器
├── image_host_uploader.py      # 图床上传器
└── examples/                   # 示例
    ├── sample_diagram.mmd
    └── sample_article.md
```

## 使用示例

### 1. 转换单个 Mermaid 图表

```python
from mermaid_uploader import MermaidUploader

uploader = MermaidUploader()

# 转换并上传
url = uploader.convert_and_upload(
    mermaid_code="""
    graph LR
        A[开始] --> B[处理]
        B --> C[结束]
    """,
    image_host="freeimage"
)

print(f"图片URL: {url}")
```

### 2. 处理 Markdown 文件

```python
from mermaid_uploader import MarkdownProcessor

processor = MarkdownProcessor()

# 处理文件,替换所有 Mermaid 为图片链接
processor.process_file("article.md", "article_with_images.md")
```

## 命令行参数

```
--input, -i      输入的 Mermaid 文件
--output, -o     输出的图片文件
--markdown, -m   处理的 Markdown 文件
--upload, -u     是否上传到图床
--image-host     指定图床 (imgur, freeimage, postimages)
--format, -f     输出格式 (png, svg, jpg)
--api-key        图床 API Key
```

## 欢迎关注

欢迎关注微信公众号:**拿客**

获取更多技术干货和开源工具分享!

## 许可证

MIT License

Files in this skill

  • GITHUB_PROFILE.md5.7 KB
  • README.md4.5 KB
  • SKILL.md2.7 KB
  • image_host_uploader.py4.2 KB
  • mermaid_converter.py8.4 KB
  • mermaid_uploader.py7.2 KB
  • package.json615 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.