Task Router Skill
Task Router
Mermaid 图片生成与图床上传技能
Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.
SkillHub CLI
skillhub install coder-knock/mermaid-image-uploaderExaminez la source et la compatibilité, puis suivez les étapes d’installation.
Donnez le lien à votre agent et demandez-lui d’examiner instructions et dépendances avant d’expliquer les étapes.
将 Mermaid 图表转换为图片并上传到免费图床,专为公众号文章设计。
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
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}")
from mermaid_uploader import MarkdownProcessor
processor = MarkdownProcessor()
# 处理文件,替换所有 Mermaid 为图片链接
processor.process_file("article.md", "article_with_images.md")
--input, -i 输入的 Mermaid 文件
--output, -o 输出的图片文件
--...
Ces informations proviennent de l’analyse indexée et peuvent être anciennes. Vérifiez les fichiers actuels.
专为公众号文章设计的 Mermaid 图表转换与图床上传工具。
🎨 多种转换方式
☁️ 支持多个免费图床
📝 批量处理 Markdown
🔗 自动生成 Markdown 代码
 代码pip install requests
# 使用 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
# 转换文件并上传
python mermaid_uploader.py --input diagram.mmd --upload
# 指定图床
python mermaid_uploader.py --input diagram.mmd --upload --image-host postimages
# 处理文件中的所有 Mermaid 图表
python mermaid_uploader.py --markdown article.md
# 指定输出文件
python mermaid_uploader.py --markdown article.md --output-markdown article_final.md
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 方式!
# 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 输出的图片文件
--...# Mermaid 图片生成与图床上传技能
专为公众号文章设计的 Mermaid 图表转换与图床上传工具。
## ✨ 功能特性
- 🎨 **多种转换方式**
- Kroki 在线转换(推荐,无需安装)
- mermaid-cli(本地转换)
- HTML 预览(浏览器打开截图)
- ☁️ **支持多个免费图床**
- FreeImage.host(免费,国内访问快)
- Postimages(简单易用)
- Imgur(稳定,国外)
- 📝 **批量处理 Markdown**
- 自动识别文件中的所有 Mermaid 图表
- 一键替换为图片链接
- 保留原始文件格式
- 🔗 **自动生成 Markdown 代码**
- 转换完成后直接给出 `` 代码
- 方便直接复制到公众号文章
## 🚀 快速开始
### 安装依赖
```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 方式!**
## 📁...Task Router
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,...
Real-time event bus for AI agents. Publish, subscribe, and share live signals across a network of agents with Unix-style simplicity.
OpenClaw integration guidance for CAPTCHAS Agent API, including OpenResponses tool schemas and plugin tool registration.