pptx by aiskillstore/marketplace
npx skills add https://github.com/aiskillstore/marketplace --skill pptx用户可能会要求您创建、编辑或分析 .pptx 文件的内容。.pptx 文件本质上是一个包含 XML 文件和其他资源的 ZIP 压缩包,您可以读取或编辑这些内容。针对不同的任务,您可以使用不同的工具和工作流程。
如果只需要读取演示文稿的文本内容,应将文档转换为 Markdown 格式:
# 将文档转换为 Markdown
python -m markitdown path-to-file.pptx
对于以下功能,您需要原始 XML 访问权限:批注、演讲者备注、幻灯片版式、动画、设计元素和复杂格式。对于任何这些功能,您都需要解包演示文稿并读取其原始 XML 内容。
python ooxml/scripts/unpack.py <office_file> <output_dir>
注意:unpack.py 脚本位于项目根目录下的 skills/pptx/ooxml/scripts/unpack.py。如果此路径不存在该脚本,请使用 find . -name "unpack.py" 来定位它。
ppt/presentation.xml - 主演示文稿元数据和幻灯片引用ppt/slides/slide{N}.xml - 单个幻灯片内容(slide1.xml、slide2.xml 等)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
ppt/notesSlides/notesSlide{N}.xml - 每个幻灯片的演讲者备注ppt/comments/modernComment_*.xml - 特定幻灯片的批注ppt/slideLayouts/ - 幻灯片版式模板ppt/slideMasters/ - 母版幻灯片模板ppt/theme/ - 主题和样式信息ppt/media/ - 图像和其他媒体文件当给定一个示例设计需要模仿时:始终首先使用以下方法分析演示文稿的字体和颜色:
ppt/theme/theme1.xml 中的颜色 (<a:clrScheme>) 和字体 (<a:fontScheme>)ppt/slides/slide1.xml 中的实际字体使用 (<a:rPr>) 和颜色<a:solidFill>, <a:srgbClr>) 和字体引用从头开始创建新的 PowerPoint 演示文稿时,请使用 html2pptx 工作流程,将 HTML 幻灯片转换为具有精确定位的 PowerPoint。
关键:在创建任何演示文稿之前,请分析内容并选择合适的设计元素:
要求:
创造性地选择颜色:
示例调色板(使用这些来激发创意 - 选择一个、调整它或创建您自己的):
几何图案:
边框与框架处理:
字体处理:
图表与数据样式:
布局创新:
背景处理:
创建包含图表或表格的幻灯片时:
html2pptx.md。阅读此文件时切勿设置任何范围限制。 在继续创建演示文稿之前,请阅读完整的文件内容以了解详细语法、关键格式规则和最佳实践。<p>、<h1>-<h6>、<ul>、<ol>
* 对于将要添加图表/表格的区域,使用 class="placeholder"(为可见性渲染为灰色背景)
* 关键:首先使用 Sharp 将渐变和图标栅格化为 PNG 图像,然后在 HTML 中引用
* 布局:对于包含图表/表格/图像的幻灯片,使用全幻灯片布局或两栏布局以获得更好的可读性html2pptx.js 库创建并运行一个 JavaScript 文件,将 HTML 幻灯片转换为 PowerPoint 并保存演示文稿
* 使用 html2pptx() 函数处理每个 HTML 文件
* 使用 PptxGenJS API 将图表和表格添加到占位符区域
* 使用 pptx.writeFile() 保存演示文稿python scripts/thumbnail.py output.pptx workspace/thumbnails --cols 4
* 读取并仔细检查缩略图图像,查看:
当编辑现有 PowerPoint 演示文稿中的幻灯片时,您需要使用原始的 Office Open XML (OOXML) 格式。这涉及解包 .pptx 文件、编辑 XML 内容并重新打包。
ooxml.md(约 500 行)。阅读此文件时切勿设置任何范围限制。 在进行任何演示文稿编辑之前,请阅读完整的文件内容以了解 OOXML 结构和编辑工作流程的详细指导。python ooxml/scripts/unpack.py <office_file> <output_dir>ppt/slides/slide{N}.xml 和相关文件)python ooxml/scripts/validate.py <dir> --original <file>python ooxml/scripts/pack.py <input_directory> <office_file>当您需要创建一个遵循现有模板设计的演示文稿时,您需要先复制并重新排列模板幻灯片,然后替换占位符内容。
* 提取文本:`python -m markitdown template.pptx > template-content.md`
* 阅读 `template-content.md`:阅读整个文件以了解模板演示文稿的内容。**阅读此文件时切勿设置任何范围限制。**
* 创建缩略图网格:`python scripts/thumbnail.py template.pptx`
* 有关更多详细信息,请参阅“创建缩略图网格”部分
2. 分析模板并将清单保存到文件:
* **视觉分析**:查看缩略图网格以了解幻灯片布局、设计模式和视觉结构
* 在 `template-inventory.md` 处创建并保存一个模板清单文件,内容如下:
# 模板清单分析
**总幻灯片数:[count]**
**重要提示:幻灯片索引从 0 开始(第一张幻灯片 = 0,最后一张幻灯片 = count-1)**
## [类别名称]
- 幻灯片 0:[版式代码(如果可用)] - 描述/用途
- 幻灯片 1:[版式代码] - 描述/用途
- 幻灯片 2:[版式代码] - 描述/用途
[... 必须单独列出每张幻灯片及其索引 ...]
* **使用缩略图网格**:参考视觉缩略图来识别:
* 布局模式(标题幻灯片、内容布局、章节分隔符)
* 图像占位符的位置和数量
* 跨幻灯片组的设计一致性
* 视觉层次结构和结构
* 此清单文件是下一步选择合适模板的**必需**文件
3. 基于模板清单创建演示文稿大纲:
* 查看步骤 2 中的可用模板。
* 为第一张幻灯片选择一个介绍或标题模板。这应该是首批模板之一。
* 为其他幻灯片选择安全的、基于文本的布局。
* **关键:使布局结构与实际内容相匹配**:
* 单栏布局:用于统一的叙述或单一主题
* 两栏布局:**仅当**您恰好有 2 个不同的项目/概念时使用
* 三栏布局:**仅当**您恰好有 3 个不同的项目/概念时使用
* 图像 + 文本布局:**仅当**您有实际图像要插入时使用
* 引用布局:**仅用于**来自人物的实际引用(带署名),切勿用于强调
* 切勿使用占位符数量超过您内容数量的布局
* 如果您有 2 个项目,不要强行将它们放入 3 栏布局
* 如果您有 4 个或更多项目,请考虑分成多张幻灯片或使用列表格式
* **在选择布局之前**,计算您实际的内容片段数量
* 验证所选布局中的每个占位符都将填充有意义的内容
* 为每个内容部分选择**最佳**布局的一个选项。
* 保存 `outline.md`,其中包含内容以及利用可用设计的模板映射
* 模板映射示例:
# 要使用的模板幻灯片(基于 0 的索引)
# 警告:验证索引在范围内!包含 73 张幻灯片的模板索引为 0-72
# 映射:大纲中的幻灯片编号 -> 模板幻灯片索引
template_mapping = [
0, # 使用幻灯片 0(标题/封面)
34, # 使用幻灯片 34(B1:标题和正文)
34, # 再次使用幻灯片 34(为第二个 B1 复制)
50, # 使用幻灯片 50(E1:引用)
54, # 使用幻灯片 54(F2:结束语 + 文本)
]
4. 使用 rearrange.py 复制、重新排序和删除幻灯片:
* 使用 `scripts/rearrange.py` 脚本创建一个具有所需顺序幻灯片的新演示文稿:
python scripts/rearrange.py template.pptx working.pptx 0,34,34,50,52
* 该脚本会自动处理重复幻灯片的复制、未使用幻灯片的删除和重新排序
* 幻灯片索引从 0 开始(第一张幻灯片是 0,第二张是 1,依此类推)
* 同一幻灯片索引可以出现多次以复制该幻灯片
5. 使用 inventory.py 脚本提取所有文本:
* **运行清单提取**:
python scripts/inventory.py working.pptx text-inventory.json
* **阅读 text-inventory.json**:阅读整个 text-inventory.json 文件以了解所有形状及其属性。**阅读此文件时切勿设置任何范围限制。**
* 清单 JSON 结构:
{
"slide-0": {
"shape-0": {
"placeholder_type": "TITLE", // 或 null 表示非占位符
"left": 1.5, // 位置(英寸)
"top": 2.0,
"width": 7.5,
"height": 1.2,
"paragraphs": [
{
"text": "段落文本",
// 可选属性(仅在非默认值时包含):
"bullet": true, // 检测到显式项目符号
"level": 0, // 仅当 bullet 为 true 时包含
"alignment": "CENTER", // CENTER, RIGHT(非 LEFT)
"space_before": 10.0, // 段落前间距(磅)
"space_after": 6.0, // 段落后间距(磅)
"line_spacing": 22.4, // 行间距(磅)
"font_name": "Arial", // 来自第一个运行
"font_size": 14.0, // 大小(磅)
"bold": true,
"italic": false,
"underline": false,
"color": "FF0000" // RGB 颜色
}
]
}
}
}
* 关键特性:
* **幻灯片**:命名为 "slide-0"、"slide-1" 等。
* **形状**:按视觉位置(从上到下,从左到右)排序为 "shape-0"、"shape-1" 等。
* **占位符类型**:TITLE、CENTER_TITLE、SUBTITLE、BODY、OBJECT 或 null
* **默认字体大小**:从布局占位符(如果可用)提取的 `default_font_size`(磅)
* **幻灯片编号被过滤**:具有 SLIDE_NUMBER 占位符类型的形状会自动从清单中排除
* **项目符号**:当 `bullet: true` 时,始终包含 `level`(即使为 0)
* **间距**:`space_before`、`space_after` 和 `line_spacing`(磅)(仅在设置时包含)
* **颜色**:RGB 使用 `color`(例如,"FF0000"),主题颜色使用 `theme_color`(例如,"DARK_1")
* **属性**:输出中仅包含非默认值
6. 根据上一步的文本清单,生成替换文本并将数据保存到 JSON 文件:
* **关键**:首先验证清单中存在哪些形状——仅引用实际存在的形状
* **验证**:replace.py 脚本将验证您的替换 JSON 中的所有形状是否都存在于清单中
* 如果您引用了不存在的形状,您将收到一个错误,显示可用的形状
* 如果您引用了不存在的幻灯片,您将收到一个指示该幻灯片不存在的错误
* 所有验证错误都会在脚本退出前一次性显示
* **重要**:replace.py 脚本在内部使用 inventory.py 来识别**所有**文本形状
* **自动清除**:清单中的**所有**文本形状都将被清除,除非您为它们提供 "paragraphs"
* 为需要内容的形状添加 "paragraphs" 字段(而不是 "replacement_paragraphs")
* 替换 JSON 中没有 "paragraphs" 的形状将自动清除其文本
* 带有项目符号的段落将自动左对齐。当 `"bullet": true` 时,不要设置 `alignment` 属性
* 为占位符文本生成适当的替换内容
* 使用形状大小来确定适当的内容长度
* **关键**:包含来自原始清单的段落属性——不要只提供文本
* **重要**:当 bullet: true 时,**不要**在文本中包含项目符号(•, -, *)——它们会自动添加
* **基本格式规则**:
* 标题/标题通常应具有 `"bold": true`
* 列表项应具有 `"bullet": true, "level": 0`(当 bullet 为 true 时,level 是必需的)
* 保留任何对齐属性(例如,居中对齐的文本使用 `"alignment": "CENTER"`)
* 当字体属性与默认值不同时,包含字体属性(例如,`"font_size": 14.0`、`"font_name": "Lora"`)
* 颜色:RGB 使用 `"color": "FF0000"`,主题颜色使用 `"theme_color": "DARK_1"`
* 替换脚本期望**正确格式化的段落**,而不仅仅是文本字符串
* **重叠形状**:优先选择具有较大 default_font_size 或更合适 placeholder_type 的形状
* 将包含替换内容的更新清单保存到 `replacement-text.json`
* **警告**:不同的模板布局具有不同数量的形状——在创建替换内容之前,始终检查实际清单
显示正确格式的 paragraphs 字段示例:
"paragraphs": [
{
"text": "新演示文稿标题文本",
"alignment": "CENTER",
"bold": true
},
{
"text": "章节标题",
"bold": true
},
{
"text": "第一个项目符号点(不带项目符号)",
"bullet": true,
"level": 0
},
{
"text": "红色文本",
"color": "FF0000"
},
{
"text": "主题颜色文本",
"theme_color": "DARK_1"
},
{
"text": "无特殊格式的常规段落文本"
}
]
未在替换 JSON 中列出的形状会自动被清除:
{
"slide-0": {
"shape-0": {
"paragraphs": [...] // 此形状获得新文本
}
// 清单中的 shape-1 和 shape-2 将自动被清除
}
}
演示文稿的常见格式模式:
* 标题幻灯片:粗体文本,有时居中对齐
* 幻灯片内的章节标题:粗体文本
* 项目符号列表:每个项目都需要 `"bullet": true, "level": 0`
* 正文:通常不需要特殊属性
* 引用:可能具有特殊的对齐方式或字体属性
7. 使用 replace.py 脚本应用替换内容
python scripts/replace.py working.pptx replacement-text.json output.pptx
脚本将:
* 首先使用 inventory.py 中的函数提取**所有**文本形状的清单
* 验证替换 JSON 中的所有形状是否都存在于清单中
* 清除清单中识别的**所有**形状的文本
* 仅对替换 JSON 中定义了 "paragraphs" 的形状应用新文本
* 通过应用 JSON 中的段落属性来保留格式
* 自动处理项目符号、对齐方式、字体属性和颜色
* 保存更新后的演示文稿
验证错误示例:
ERROR: 替换 JSON 中存在无效形状:
- 在 'slide-0' 上未找到形状 'shape-99'。可用形状:shape-0, shape-1, shape-4
- 在清单中未找到幻灯片 'slide-999'
ERROR: 替换文本使这些形状的溢出情况恶化:
- slide-0/shape-2: 溢出恶化了 1.25"(原为 0.00",现为 1.25")
要为 PowerPoint 幻灯片创建视觉缩略图网格以便快速分析和参考:
python scripts/thumbnail.py template.pptx [output_prefix]
特性:
thumbnails.jpg(对于大型演示文稿,则为 thumbnails-1.jpg、thumbnails-2.jpg 等)python scripts/thumbnail.py template.pptx my-grid
workspace/my-grid)--cols 4(范围:3-6,影响每个网格的幻灯片数)使用场景:
示例:
# 基本用法
python scripts/thumbnail.py presentation.pptx
# 组合选项:自定义名称、列数
python scripts/thumbnail.py template.pptx analysis --cols 4
为了视觉分析 PowerPoint 幻灯片,使用两步过程将其转换为图像:
将 PPTX 转换为 PDF:
soffice --headless --convert-to pdf template.pptx
将 PDF 页面转换为 JPEG 图像:
pdftoppm -jpeg -r 150 template.pdf slide
这将创建类似 slide-1.jpg、slide-2.jpg 等的文件。
选项:
-r 150:将分辨率设置为 150 DPI(根据需要调整质量/大小平衡)-jpeg:输出 JPEG 格式(如果偏好,可使用 -png 输出 PNG)-f N:要转换的起始页(例如,-f 2 从第 2 页开始)-l N:要转换的结束页(例如,-l 5 在第 5 页停止)slide:输出文件的前缀特定范围示例:
pdftoppm -jpeg -r 150 -f 2 -l 5 template.pdf slide # 仅转换第 2-5 页
重要:为 PPTX 操作生成代码时:
所需依赖项(应已安装):
pip install "markitdown[pptx]"(用于从演示文稿中提取文本)npm install -g pptxgenjs(用于通过 html2pptx 创建演示文稿)npm install -g playwright(用于 html2pptx 中的 HTML 渲染)npm install -g react-icons react react-dom(用于图标)npm install -g sharp(用于 SVG 栅格化和图像处理)sudo apt-get install libreoffice(用于 PDF 转换)sudo apt-get install poppler-utils(用于 pdftoppm 将 PDF 转换为图像)pip install defusedxml(用于安全的 XML 解析)每周安装次数
91
代码仓库
GitHub 星标数
203
首次出现
2026 年 1 月 20 日
安全审计
安装于
opencode78
gemini-cli75
codex72
cursor72
github-copilot67
claude-code66
A user may ask you to create, edit, or analyze the contents of a .pptx file. A .pptx file is essentially a ZIP archive containing XML files and other resources that you can read or edit. You have different tools and workflows available for different tasks.
If you just need to read the text contents of a presentation, you should convert the document to markdown:
# Convert document to markdown
python -m markitdown path-to-file.pptx
You need raw XML access for: comments, speaker notes, slide layouts, animations, design elements, and complex formatting. For any of these features, you'll need to unpack a presentation and read its raw XML contents.
python ooxml/scripts/unpack.py <office_file> <output_dir>
Note : The unpack.py script is located at skills/pptx/ooxml/scripts/unpack.py relative to the project root. If the script doesn't exist at this path, use find . -name "unpack.py" to locate it.
ppt/presentation.xml - Main presentation metadata and slide referencesppt/slides/slide{N}.xml - Individual slide contents (slide1.xml, slide2.xml, etc.)ppt/notesSlides/notesSlide{N}.xml - Speaker notes for each slideppt/comments/modernComment_*.xml - Comments for specific slidesppt/slideLayouts/ - Layout templates for slidesppt/slideMasters/ - Master slide templatesppt/theme/ - Theme and styling informationppt/media/ - Images and other media filesWhen given an example design to emulate : Always analyze the presentation's typography and colors first using the methods below:
ppt/theme/theme1.xml for colors (<a:clrScheme>) and fonts (<a:fontScheme>)ppt/slides/slide1.xml for actual font usage (<a:rPr>) and colors<a:solidFill>, <a:srgbClr>) and font references across all XML filesWhen creating a new PowerPoint presentation from scratch, use the html2pptx workflow to convert HTML slides to PowerPoint with accurate positioning.
CRITICAL : Before creating any presentation, analyze the content and choose appropriate design elements:
Requirements :
Choosing colors creatively :
Example color palettes (use these to spark creativity - choose one, adapt it, or create your own):
Geometric Patterns :
Border & Frame Treatments:
Typography Treatments :
Chart & Data Styling:
Layout Innovations :
Background Treatments :
When creating slides with charts or tables:
html2pptx.md completely from start to finish. NEVER set any range limits when reading this file. Read the full file content for detailed syntax, critical formatting rules, and best practices before proceeding with presentation creation.<p>, <h1>-<h6>, <ul>, <ol> for all text contentclass="placeholder" for areas where charts/tables will be added (render with gray background for visibility)When edit slides in an existing PowerPoint presentation, you need to work with the raw Office Open XML (OOXML) format. This involves unpacking the .pptx file, editing the XML content, and repacking it.
ooxml.md (~500 lines) completely from start to finish. NEVER set any range limits when reading this file. Read the full file content for detailed guidance on OOXML structure and editing workflows before any presentation editing.python ooxml/scripts/unpack.py <office_file> <output_dir>ppt/slides/slide{N}.xml and related files)python ooxml/scripts/validate.py <dir> --original <file>python ooxml/scripts/pack.py <input_directory> <office_file>When you need to create a presentation that follows an existing template's design, you'll need to duplicate and re-arrange template slides before then replacing placeholder context.
Extract template text AND create visual thumbnail grid :
python -m markitdown template.pptx > template-content.mdtemplate-content.md: Read the entire file to understand the contents of the template presentation. NEVER set any range limits when reading this file.python scripts/thumbnail.py template.pptxAnalyze template and save inventory to a file :
Visual Analysis : Review thumbnail grid(s) to understand slide layouts, design patterns, and visual structure
Create and save a template inventory file at template-inventory.md containing:
# Template Inventory Analysis
**Total Slides: [count]**
**IMPORTANT: Slides are 0-indexed (first slide = 0, last slide = count-1)**
## [Category Name]
- Slide 0: [Layout code if available] - Description/purpose
- Slide 1: [Layout code] - Description/purpose
- Slide 2: [Layout code] - Description/purpose
[... EVERY slide must be listed individually with its index ...]
Example paragraphs field showing proper formatting:
"paragraphs": [
{
"text": "New presentation title text",
"alignment": "CENTER",
"bold": true
},
{
"text": "Section Header",
"bold": true
},
{
"text": "First bullet point without bullet symbol",
"bullet": true,
"level": 0
},
{
"text": "Red colored text",
"color": "FF0000"
},
{
"text": "Theme colored text",
"theme_color": "DARK_1"
},
{
"text": "Regular paragraph text without special formatting"
}
]
Shapes not listed in the replacement JSON are automatically cleared :
{
"slide-0": {
"shape-0": {
"paragraphs": [...] // This shape gets new text
}
// shape-1 and shape-2 from inventory will be cleared automatically
}
}
Common formatting patterns for presentations :
* Title slides: Bold text, sometimes centered
* Section headers within slides: Bold text
* Bullet lists: Each item needs `"bullet": true, "level": 0`
* Body text: Usually no special properties needed
* Quotes: May have special alignment or font properties
7. Apply replacements using thereplace.py script
python scripts/replace.py working.pptx replacement-text.json output.pptx
The script will:
* First extract the inventory of ALL text shapes using functions from inventory.py
* Validate that all shapes in the replacement JSON exist in the inventory
* Clear text from ALL shapes identified in the inventory
* Apply new text only to shapes with "paragraphs" defined in the replacement JSON
* Preserve formatting by applying paragraph properties from the JSON
* Handle bullets, alignment, font properties, and colors automatically
* Save the updated presentation
Example validation errors:
ERROR: Invalid shapes in replacement JSON:
- Shape 'shape-99' not found on 'slide-0'. Available shapes: shape-0, shape-1, shape-4
- Slide 'slide-999' not found in inventory
ERROR: Replacement text made overflow worse in these shapes:
- slide-0/shape-2: overflow worsened by 1.25" (was 0.00", now 1.25")
To create visual thumbnail grids of PowerPoint slides for quick analysis and reference:
python scripts/thumbnail.py template.pptx [output_prefix]
Features :
thumbnails.jpg (or thumbnails-1.jpg, thumbnails-2.jpg, etc. for large decks)python scripts/thumbnail.py template.pptx my-grid
workspace/my-grid)--cols 4 (range: 3-6, affects slides per grid)Use cases :
Examples :
# Basic usage
python scripts/thumbnail.py presentation.pptx
# Combine options: custom name, columns
python scripts/thumbnail.py template.pptx analysis --cols 4
To visually analyze PowerPoint slides, convert them to images using a two-step process:
Convert PPTX to PDF :
soffice --headless --convert-to pdf template.pptx
Convert PDF pages to JPEG images :
pdftoppm -jpeg -r 150 template.pdf slide
This creates files like slide-1.jpg, slide-2.jpg, etc.
Options:
-r 150: Sets resolution to 150 DPI (adjust for quality/size balance)-jpeg: Output JPEG format (use -png for PNG if preferred)-f N: First page to convert (e.g., -f 2 starts from page 2)-l N: Last page to convert (e.g., -l 5 stops at page 5)slide: Prefix for output filesExample for specific range:
pdftoppm -jpeg -r 150 -f 2 -l 5 template.pdf slide # Converts only pages 2-5
IMPORTANT : When generating code for PPTX operations:
Required dependencies (should already be installed):
pip install "markitdown[pptx]" (for text extraction from presentations)npm install -g pptxgenjs (for creating presentations via html2pptx)npm install -g playwright (for HTML rendering in html2pptx)npm install -g react-icons react react-dom (for icons)npm install -g sharp (for SVG rasterization and image processing)sudo apt-get install libreoffice (for PDF conversion)sudo apt-get install poppler-utils (for pdftoppm to convert PDF to images)Weekly Installs
91
Repository
GitHub Stars
203
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykWarn
Installed on
opencode78
gemini-cli75
codex72
cursor72
github-copilot67
claude-code66
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
40,000 周安装
Gmail 休假自动回复器设置教程 - Google Workspace CLI 命令指南
7,200 周安装
Google Workspace HR协调员技能:自动化人力资源工作流程(入职、公告、沟通)
7,200 周安装
Google Tasks 逾期任务审查指南 - 使用 gws CLI 高效管理任务列表
7,300 周安装
Google Workspace CLI 创建 Google Meet 会议空间教程 - 自动化会议创建与邮件分享
7,300 周安装
Google Workspace CLI 客户支持专员技能:自动化工单跟踪与客户沟通管理
7,300 周安装
小红书MCP脚本工具集 - 自动化搜索、分析、评论与数据导出
7,300 周安装
html2pptx.js library to convert HTML slides to PowerPoint and save the presentation
html2pptx() function to process each HTML filepptx.writeFile()python scripts/thumbnail.py output.pptx workspace/thumbnails --cols 4Using the thumbnail grid : Reference the visual thumbnails to identify:
This inventory file is REQUIRED for selecting appropriate templates in the next step
Create presentation outline based on template inventory :
Review available templates from step 2.
Choose an intro or title template for the first slide. This should be one of the first templates.
Choose safe, text-based layouts for the other slides.
CRITICAL: Match layout structure to actual content :
Count your actual content pieces BEFORE selecting the layout
Verify each placeholder in the chosen layout will be filled with meaningful content
Select one option representing the best layout for each content section.
Save outline.md with content AND template mapping that leverages available designs
Example template mapping:
# Template slides to use (0-based indexing)
# WARNING: Verify indices are within range! Template with 73 slides has indices 0-72
# Mapping: slide numbers from outline -> template slide indices
template_mapping = [
0, # Use slide 0 (Title/Cover)
34, # Use slide 34 (B1: Title and body)
34, # Use slide 34 again (duplicate for second B1)
50, # Use slide 50 (E1: Quote)
54, # Use slide 54 (F2: Closing + Text)
]
Duplicate, reorder, and delete slides usingrearrange.py:
Use the scripts/rearrange.py script to create a new presentation with slides in the desired order:
python scripts/rearrange.py template.pptx working.pptx 0,34,34,50,52
The script handles duplicating repeated slides, deleting unused slides, and reordering automatically
Slide indices are 0-based (first slide is 0, second is 1, etc.)
The same slide index can appear multiple times to duplicate that slide
Extract ALL text using theinventory.py script:
Run inventory extraction :
python scripts/inventory.py working.pptx text-inventory.json
Read text-inventory.json : Read the entire text-inventory.json file to understand all shapes and their properties. NEVER set any range limits when reading this file.
The inventory JSON structure:
{
"slide-0": {
"shape-0": {
"placeholder_type": "TITLE", // or null for non-placeholders
"left": 1.5, // position in inches
"top": 2.0,
"width": 7.5,
"height": 1.2,
"paragraphs": [
{
"text": "Paragraph text",
// Optional properties (only included when non-default):
"bullet": true, // explicit bullet detected
"level": 0, // only included when bullet is true
"alignment": "CENTER", // CENTER, RIGHT (not LEFT)
"space_before": 10.0, // space before paragraph in points
"space_after": 6.0, // space after paragraph in points
"line_spacing": 22.4, // line spacing in points
"font_name": "Arial", // from first run
"font_size": 14.0, // in points
"bold": true,
"italic": false,
"underline": false,
"color": "FF0000" // RGB color
}
]
}
}
}
Key features:
default_font_size in points extracted from layout placeholders (when available)bullet: true, level is always included (even if 0)space_before, space_after, and line_spacing in points (only included when set)color for RGB (e.g., "FF0000"), for theme colors (e.g., "DARK_1")Generate replacement text and save the data to a JSON file Based on the text inventory from the previous step:
alignment property on when "bullet": true"bold": true"bullet": true, "level": 0 (level is required when bullet is true)"alignment": "CENTER" for centered text)"font_size": 14.0, "font_name": "Lora")"color": "FF0000" for RGB or "theme_color": "DARK_1" for theme colorsreplacement-text.jsonpip install defusedxml (for secure XML parsing)theme_color