pptx-skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PPTX 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 reading
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 reading

Core Workflows

核心工作流

1. Presentation Generation (python-pptx)

1. 演示文稿生成(python-pptx)

  1. Install python-pptx
  2. Create Presentation object
  3. Add slides from layouts
  4. Add content (text, images, tables)
  5. Apply formatting
  6. Save presentation
  1. 安装python-pptx
  2. 创建Presentation对象
  3. 从布局中添加幻灯片
  4. 添加内容(文本、图片、表格)
  5. 应用格式设置
  6. 保存演示文稿

2. Chart Creation

2. 图表创建

  1. Prepare data for chart
  2. Create chart data object
  3. Add chart to slide
  4. Configure chart type and options
  5. Style chart elements
  6. Position and size appropriately
  1. 准备图表数据
  2. 创建图表数据对象
  3. 向幻灯片添加图表
  4. 配置图表类型和选项
  5. 设置图表元素样式
  6. 合理设置位置和尺寸

3. Template-Based Generation

3. 基于模板的生成

  1. Create master template with placeholders
  2. Load template in code
  3. Identify placeholder shapes
  4. Replace placeholder content
  5. Add dynamic slides as needed
  6. Save as new file
  1. 创建包含占位符的主模板
  2. 在代码中加载模板
  3. 识别占位符形状
  4. 替换占位符内容
  5. 根据需要添加动态幻灯片
  6. 另存为新文件

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-PatternProblemCorrect Approach
Ignoring layoutsInconsistent formattingUse slide layouts
Hardcoded positionsLayout breaksUse placeholders
Too much text per slideUnreadableLimit content, use bullets
Missing templatesReinventing stylingCreate reusable templates
No error handlingCorrupted filesValidate and handle errors
反模式问题正确做法
忽略布局格式不一致使用幻灯片布局
硬编码位置布局错乱使用占位符
单页幻灯片文本过多可读性差精简内容,使用项目符号
未使用模板重复设置样式创建可复用模板
无错误处理文件损坏验证并处理错误