用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Dwsy/svg-card-generator --skill svg-card-generator命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | svg-card-generator |
| description | 将结构化内容转换为精美SVG卡片并渲染为高分辨率PNG。适用于知识卡片、信息图、总结海报等场景。支持自定义模板、中文字体、多分辨率输出。 |
| emoji | 🎴 |
| triggers | ["制作卡片","SVG卡片","信息图","知识卡片","海报"] |
将Markdown或结构化数据转换为精美SVG卡片,并渲染为高分辨率PNG。
# 基础用法
bun ~/.pi/agent/skills/svg-card-generator/scripts/generate.ts
# 指定输入文件和分辨率
bun scripts/generate.ts --input content.json --scale 4
# 使用自定义模板
bun scripts/generate.ts --template my-template.svg --scale 6
| 参数 | 说明 | 默认值 |
|---|---|---|
--input, -i | 输入JSON文件路径 | 交互式输入 |
--output, -o | 输出文件路径 | ./output-{timestamp}.png |
--template, -t | SVG模板路径 | 使用内置模板 |
--scale, -s | 输出分辨率倍数 | 4 |
--format, -f | 输出格式 (png/svg) | png |
{
"title": "标题",
"subtitle": "副标题",
"source": "来源",
"sections": [
{
"title": "区块标题",
"type": "list|timeline|points|formula|quote",
"items": [...]
}
],
"footer": "页脚文字"
}
{
"type": "list",
"items": [
{ "icon": "1", "title": "标题", "desc": "描述" }
]
}
{
"type": "timeline",
"items": [
{ "year": "2026", "text": "事件描述" }
]
}
{
"type": "points",
"items": [
{ "icon": "💡", "title": "标题", "desc": "描述" }
]
}
{
"type": "formula",
"formula": "作品质量 = 材料 × 品味",
"lines": ["材料来自真实世界", "品味来自长期训练"]
}
{
"type": "quote",
"text": "引用文字"
}
{
"type": "compare",
"left": { "label": "错误", "title": "标题", "items": [...] },
"right": { "label": "正确", "title": "标题", "items": [...] }
}
# Node.js依赖
bun add @resvg/resvg-js
# 系统字体(中文)
apt install fonts-noto-cjk
# 从JSON生成卡片
echo '{
"title": "AI使用指南",
"subtitle": "把AI接进工作流程",
"sections": [
{
"title": "核心原则",
"type": "list",
"items": [
{ "icon": "1", "title": "可追溯", "desc": "不要黑箱" },
{ "icon": "2", "title": "可操纵", "desc": "控制过程" }
]
}
]
}' | bun scripts/generate.ts --scale 4
模板使用标准SVG,支持以下占位符:
{{title}} - 标题{{subtitle}} - 副标题{{source}} - 来源{{sections}} - 区块列表{{footer}} - 页脚模板需定义以下CSS变量或样式:
Noto Sans CJK SC, sans-serif#e85d04#faf9f7