pptx-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePPTX Skill
PPTX技能
Purpose
用途
Provides expertise in programmatic PowerPoint presentation creation, editing, and automation. Specializes in using python-pptx (Python) and PptxGenJS (JavaScript) for generating dynamic slide decks and automating presentation workflows.
提供以编程方式创建、编辑和自动化PowerPoint演示文稿的专业能力。专注于使用python-pptx(Python)和PptxGenJS(JavaScript)生成动态幻灯片集并自动化演示文稿工作流。
When to Use
适用场景
- Generating presentations programmatically
- Creating slides from data sources
- Modifying existing PowerPoint files
- Building automated report generators
- Adding charts and tables to slides
- Applying templates and branding
- Extracting content from presentations
- Batch processing multiple presentations
- 以编程方式生成演示文稿
- 从数据源生成幻灯片
- 修改现有PowerPoint文件
- 构建自动化报告生成器
- 向幻灯片添加图表和表格
- 应用模板和品牌样式
- 从演示文稿中提取内容
- 批量处理多个演示文稿
Quick Start
快速入门
Invoke this skill when:
- Creating PowerPoint files from code
- Automating slide generation
- Modifying existing PPTX files
- Building presentation templates
- Extracting data from slides
Do NOT invoke when:
- PDF generation → use
/pdf-skill - Word documents → use
/docx-skill - Excel files → use
/xlsx-skill - Manual presentation design → use appropriate design tools
在以下场景调用本技能:
- 通过代码创建PowerPoint文件
- 自动化幻灯片生成
- 修改现有PPTX文件
- 构建演示文稿模板
- 从幻灯片中提取数据
请勿在以下场景调用本技能:
- PDF生成 → 请使用
/pdf-skill - Word文档 → 请使用
/docx-skill - Excel文件 → 请使用
/xlsx-skill - 手动演示文稿设计 → 请使用合适的设计工具
Decision Framework
决策框架
PPTX Operation?
├── Generate from Scratch
│ ├── Python → python-pptx
│ └── JavaScript → PptxGenJS
├── Modify Existing
│ └── python-pptx (read + modify)
├── Template-Based
│ └── Load template, fill placeholders
└── Extract Content
└── python-pptx for readingPPTX Operation?
├── Generate from Scratch
│ ├── Python → python-pptx
│ └── JavaScript → PptxGenJS
├── Modify Existing
│ └── python-pptx (read + modify)
├── Template-Based
│ └── Load template, fill placeholders
└── Extract Content
└── python-pptx for readingCore Workflows
核心工作流
1. Presentation Generation (python-pptx)
1. 演示文稿生成(python-pptx)
- Install python-pptx
- Create Presentation object
- Add slides from layouts
- Add content (text, images, tables)
- Apply formatting
- Save presentation
- 安装python-pptx
- 创建Presentation对象
- 从布局中添加幻灯片
- 添加内容(文本、图片、表格)
- 应用格式设置
- 保存演示文稿
2. Chart Creation
2. 图表创建
- Prepare data for chart
- Create chart data object
- Add chart to slide
- Configure chart type and options
- Style chart elements
- Position and size appropriately
- 准备图表数据
- 创建图表数据对象
- 向幻灯片添加图表
- 配置图表类型和选项
- 设置图表元素样式
- 合理设置位置和尺寸
3. Template-Based Generation
3. 基于模板的生成
- Create master template with placeholders
- Load template in code
- Identify placeholder shapes
- Replace placeholder content
- Add dynamic slides as needed
- Save as new file
- 创建包含占位符的主模板
- 在代码中加载模板
- 识别占位符形状
- 替换占位符内容
- 根据需要添加动态幻灯片
- 另存为新文件
Best Practices
最佳实践
- Use slide layouts from the template
- Keep text within placeholder boundaries
- Use appropriate chart types for data
- Maintain consistent styling
- Test output in PowerPoint
- Handle missing fonts gracefully
- 使用模板中的幻灯片布局
- 文本内容保持在占位符范围内
- 根据数据选择合适的图表类型
- 保持样式一致性
- 在PowerPoint中测试输出效果
- 优雅处理缺失字体的情况
Anti-Patterns
反模式
| Anti-Pattern | Problem | Correct Approach |
|---|---|---|
| Ignoring layouts | Inconsistent formatting | Use slide layouts |
| Hardcoded positions | Layout breaks | Use placeholders |
| Too much text per slide | Unreadable | Limit content, use bullets |
| Missing templates | Reinventing styling | Create reusable templates |
| No error handling | Corrupted files | Validate and handle errors |
| 反模式 | 问题 | 正确做法 |
|---|---|---|
| 忽略布局 | 格式不一致 | 使用幻灯片布局 |
| 硬编码位置 | 布局错乱 | 使用占位符 |
| 单页幻灯片文本过多 | 可读性差 | 精简内容,使用项目符号 |
| 未使用模板 | 重复设置样式 | 创建可复用模板 |
| 无错误处理 | 文件损坏 | 验证并处理错误 |