Search

PythonReactSEOPDF
OpenClaw

Mermaid Image Uploader

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

coder-knock0 source installs☆ 0 Repository stars

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install coder-knock/mermaid-image-uploader

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

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

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

功能特性

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

快速开始

安装依赖
pip install mermaid-cli requests

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

npm install -g @mermaid-js/mermaid-cli
使用方法
# 转换单个 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 图表
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 文件
from mermaid_uploader import MarkdownProcessor

processor = MarkdownProcessor()

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

命令行参数

--input, -i      输入的 Mermaid 文件
--output, -o     输出的图片文件
--...

Source information

Source
github
Repository
openclaw/skills
Path
skills/coder-knock/mermaid-image-uploader
Version
—
Commit
e89db4dcdbd3f28660a57cc4332d7757c3f5819a
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

README

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

专为公众号文章设计的 Mermaid 图表转换与图床上传工具。

✨ 功能特性

  • 🎨 多种转换方式

    • Kroki 在线转换(推荐,无需安装)
    • mermaid-cli(本地转换)
    • HTML 预览(浏览器打开截图)
  • ☁️ 支持多个免费图床

    • FreeImage.host(免费,国内访问快)
    • Postimages(简单易用)
    • Imgur(稳定,国外)
  • 📝 批量处理 Markdown

    • 自动识别文件中的所有 Mermaid 图表
    • 一键替换为图片链接
    • 保留原始文件格式
  • 🔗 自动生成 Markdown 代码

    • 转换完成后直接给出 ![图片](URL) 代码
    • 方便直接复制到公众号文章

🚀 快速开始

安装依赖
pip install requests
基本使用
1. 转换单个 Mermaid 代码
# 使用 HTML 方式(最简单,无需其他工具)
python mermaid_uploader.py --code "graph LR A-->B" --format html

# 使用 Kroki 在线转换
python mermaid_uploader.py --code "graph LR A-->B" --format png --upload
2. 转换 Mermaid 文件
# 转换文件并上传
python mermaid_uploader.py --input diagram.mmd --upload

# 指定图床
python mermaid_uploader.py --input diagram.mmd --upload --image-host postimages
3. 处理 Markdown 文件
# 处理文件中的所有 Mermaid 图表
python mermaid_uploader.py --markdown article.md

# 指定输出文件
python mermaid_uploader.py --markdown article.md --output-markdown article_final.md
Python API 使用
from mermaid_uploader import MermaidUploader

uploader = MermaidUploader()

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

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

📋 支持的图床

图床 需要API Key 特点
FreeImage.host ❌ 免费,国内访问快,推荐
Postimages ❌ 简单易用,界面友好
Imgur ✅ 稳定,国际知名

🎯 转换方式对比

方式 需要安装 速度 质量
Kroki ❌ 快 好
mermaid-cli ✅ Node.js 快 最好
HTML ❌ 快 需手动截图

推荐优先使用 Kroki 方式!

📁...

Extracted content

SKILL.md
# 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     输出的图片文件
--...
README
# Mermaid 图片生成与图床上传技能

专为公众号文章设计的 Mermaid 图表转换与图床上传工具。

## ✨ 功能特性

- 🎨 **多种转换方式**
  - Kroki 在线转换(推荐,无需安装)
  - mermaid-cli(本地转换)
  - HTML 预览(浏览器打开截图)

- ☁️ **支持多个免费图床**
  - FreeImage.host(免费,国内访问快)
  - Postimages(简单易用)
  - Imgur(稳定,国外)

- 📝 **批量处理 Markdown**
  - 自动识别文件中的所有 Mermaid 图表
  - 一键替换为图片链接
  - 保留原始文件格式

- 🔗 **自动生成 Markdown 代码**
  - 转换完成后直接给出 `![图片](URL)` 代码
  - 方便直接复制到公众号文章

## 🚀 快速开始

### 安装依赖

```bash
pip install requests
```

### 基本使用

#### 1. 转换单个 Mermaid 代码

```bash
# 使用 HTML 方式(最简单,无需其他工具)
python mermaid_uploader.py --code "graph LR A-->B" --format html

# 使用 Kroki 在线转换
python mermaid_uploader.py --code "graph LR A-->B" --format png --upload
```

#### 2. 转换 Mermaid 文件

```bash
# 转换文件并上传
python mermaid_uploader.py --input diagram.mmd --upload

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

#### 3. 处理 Markdown 文件

```bash
# 处理文件中的所有 Mermaid 图表
python mermaid_uploader.py --markdown article.md

# 指定输出文件
python mermaid_uploader.py --markdown article.md --output-markdown article_final.md
```

### Python API 使用

```python
from mermaid_uploader import MermaidUploader

uploader = MermaidUploader()

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

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

## 📋 支持的图床

| 图床 | 需要API Key | 特点 |
|------|------------|------|
| FreeImage.host | ❌ | 免费,国内访问快,推荐 |
| Postimages | ❌ | 简单易用,界面友好 |
| Imgur | ✅ | 稳定,国际知名 |

## 🎯 转换方式对比

| 方式 | 需要安装 | 速度 | 质量 |
|------|---------|------|------|
| Kroki | ❌ | 快 | 好 |
| mermaid-cli | ✅ Node.js | 快 | 最好 |
| HTML | ❌ | 快 | 需手动截图 |

**推荐优先使用 Kroki 方式!**

## 📁...

Related skills

OpenClaw

x402hub

capncoconut

Register, communicate, and earn on the x402hub AI agent marketplace. Use when an agent needs to register on x402hub, browse or claim bounties, submit deliverables, send messages to other agents via x402 Relay,...

OpenClaw

claw

capevace

Real-time event bus for AI agents. Publish, subscribe, and share live signals across a network of agents with Unix-style simplicity.

OpenClaw

captchas-openclaw

captchasco

OpenClaw integration guidance for CAPTCHAS Agent API, including OpenResponses tool schemas and plugin tool registration.