集市场顶尖skill之大成,打造最强PPT生成器!
集成功能来源:
anthropics/pptx → 模板支持、演讲者备注openai/slides → 溢出检测、PNG预览、布局助手pptx-generator → Markdown内容支持pip install python-pptx pillow pandas openpyxl
python scripts/create_ppt.py --input content.json --output output.pptx
| Param | Required | Description |
|---|---|---|
| ------- | ---------- | ------------- |
--input | Yes | JSON内容文件路径 |
--output | No | 输出PPTX路径(默认:output.pptx) |
--template | No | 模板PPTX路径(可选) |
--check-overflow | No | 启用溢出检测(默认:false) |
--preview-dir | No | PNG预览输出目录(可选) |
{
"title": "主标题",
"subtitle": "副标题",
"company": "OrangeCRDE",
"website": "www.orangecrde.com",
"slides": [
// === 原有8种幻灯片类型(向下兼容)===
{
"type": "cover",
"title_line1": "橙色云",
"title_line2": "智橙PLM解决方案",
"subtitle": "副标题文字",
"website": "www.orangecrde.com"
},
{
"type": "section_title",
"number": "01",
"section_title": "章节标题",
"subtitle": "章节副标题"
},
{
"type": "content_overview",
"section_title": "页面标题",
"description": "概述文字(用 \\n 换行)",
"highlights": [
{"title": "亮点1", "desc": "描述文字"},
{"title": "亮点2", "desc": "描述文字"},
{"title": "亮点3", "desc": "描述文字"},
{"title": "亮点4", "desc": "描述文字"}
]
},
{
"type": "content_features",
"section_title": "功能模块",
"categories": [
{"name": "分类A", "items": ["功能1", "功能2", "功能3"]},
{"name": "分类B", "items": ["功能1", "功能2", "功能3"]}
]
},
{
"type": "content_with_image",
"section_title": "页面标题",
"left_title": "左侧标题(可选)",
"left_text": "左侧说明文字(用 \\n 换行)...",
"image_path": "path/to/image.png"
},
{
"type": "table",
"section_title": "表格标题",
"headers": ["列1", "列2", "列3"],
"rows": [["值1", "值2", "值3"], ["值4", "值5", "值6"]]
},
{
"type": "flow",
"section_title": "流程标题",
"steps": ["步骤1", "步骤2", "步骤3", "步骤4"],
"labels": ["标签A", "标签B"]
},
// === 新增:图表页(集成openai/slides)===
{
"type": "chart",
"section_title": "数据图表",
"chart_type": "column", // column(柱状图), line(折线图), pie(饼图), bar(条形图)
"categories": ["Q1", "Q2", "Q3", "Q4"],
"series": [
{"name": "产品A", "values": [120, 150, 180, 210]},
{"name": "产品B", "values": [90, 130, 160, 190]}
],
"width": 6.5, // 可选,默认6.5
"height": 4.0 // 可选,默认4.0
},
// === 新增:对比页 ===
{
"type": "comparison",
"section_title": "方案对比",
"left_title": "方案A",
"left_items": ["特点1", "特点2", "特点3"],
"right_title": "方案B",
"right_items": ["特点1", "特点2", "特点3"],
"winner": "left" // left/right,高亮获胜方
},
// === 新增:时间线页 ===
{
"type": "timeline",
"section_title": "项目时间线",
"items": [
{"date": "2024 Q1", "title": "需求调研", "desc": "完成10家竞品分析"},
{"date": "2024 Q2", "title": "方案设计", "desc": "完成AIPLM架构设计"},
{"date": "2024 Q3", "title": "开发实施", "desc": "完成核心功能开发"},
{"date": "2024 Q4", "title": "上线运营", "desc": "正式投入使用"}
]
},
// === 新增:引用页 ===
{
"type": "quote",
"quote_text": "AI不会取代人类,但会用AI的人会取代不会用AI的人。",
"author": "—— 某位智者",
"bg_opacity": 80 // 可选,背景透明度 0-100
},
// === 新增:图片画廊页 ===
{
"type": "gallery",
"section_title": "产品截图",
"images": [
{"path": "path/to/img1.png", "caption": "功能模块A"},
{"path": "path/to/img2.png", "caption": "功能模块B"},
{"path": "path/to/img3.png", "caption": "功能模块C"},
{"path": "path/to/img4.png", "caption": "功能模块D"}
]
},
// === 新增:团队介绍页 ===
{
"type": "team",
"section_title": "核心团队",
"members": [
{"name": "张三", "role": "项目经理", "avatar": "path/to/avatar1.png"},
{"name": "李四", "role": "技术总监", "avatar": "path/to/avatar2.png"},
{"name": "王五", "role": "产品经理", "avatar": "path/to/avatar3.png"}
]
},
// === 新增:二维码页 ===
{
"type": "qrcode",
"section_title": "扫码体验",
"qr_path": "path/to/qrcode.png",
"description": "扫描二维码,立即体验智橙PLM系统"
},
// === 结尾页(官方模板风格)===
{
"type": "closing",
"title": "感谢大家聆听",
"subtitle": "打破创新边界,赋能未来制造",
"keywords": "协同设计 | 数据拉通 | 云上研发 | 快速出图 | 高效选配",
"contact": "www.orangecrde.com"
}
]
}
| Type | Description |
|---|---|
| ------ | ------------- |
cover | 封面页 — 橙色全屏背景 + 白色大标题 + 科技装饰 |
section_title | 章节页 — 左侧橙色区块 + 编号 + 右侧标题 |
content_overview | 概述页 — 标题 + 描述 + 2×2 亮点卡片(带阴影) |
content_features | 功能矩阵 — 分类标题 + 橙色圆点功能项网格 |
content_with_image | 图文页 — 左侧文字 + 右侧图片 |
table | 表格页 — 橙色表头 + 交替行色数据表格 |
flow | 流程页 — 橙色圆角步骤框 + 箭头 + 标签胶囊 |
closing | 结尾页 — 橙色全屏背景 + 白色感谢文字 |
| Type | Description | 集成来源 |
|---|---|---|
| ------ | ------------- | ---------- |
chart | 图表页 — 柱状图/折线图/饼图/条形图 | openai/slides |
comparison | 对比页 — 左右方案对比,高亮获胜方 | 新增 |
timeline | 时间线页 — 项目时间节点展示 | 新增 |
quote | 引用页 — 大号引用文字 + 作者 | 新增 |
gallery | 图片画廊 — 2×2/1×3/3×1图片网格 | 新增 |
team | 团队页 — 成员头像+姓名+角色 | 新增 |
qrcode | 二维码页 — 二维码+说明文字 | 新增 |
#FC5900 (orange)#FF6E0A#E06020#FFFFFF#333333#666666#FFFFFFpython scripts/create_ppt.py --input content.json --output output.pptx --template template.pptx
python scripts/create_ppt.py --input content.json --check-overflow
python scripts/create_ppt.py --input content.json --preview-dir ./previews
JSON格式:
{
"type": "content_overview",
"section_title": "页面标题",
"notes": "这是演讲者备注,观众看不到,只有演示者能看到",
"highlights": [...]
}
支持的图表类型:
column - 柱状图(垂直)bar - 条形图(水平)line - 折线图pie - 饼图pip install python-pptx)pip install pillow) - 用于PNG预览pip install pandas) - 可选,用于数据处理pip install openpyxl) - 可选,用于Excel数据导入系统会在以下情况发出警告:
检测方法:
共 1 个版本