关于 pptx-profile
pptx-profile 用于梳理 PowerPoint 模板中的布局,服务于幻灯片编写和渲染流程。它生成易读的布局目录和机器可读的配置,供后续步骤精准选择布局。
主要功能
- 01列出可提示布局和原始布局
- 02展示占位符及布局用途
- 03生成 JSON 布局配置
- 04支持仅生成目录
- 05在多份演示文稿中复用配置
适用场景
- 01编写幻灯片前检查模板
- 02为每页选择布局提示
- 03为演示文稿渲染准备配置
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ tristan-mcinnis/ pptx-from-layouts-skill --skill pptx-profile安装后在 Claude Code 中输入/pptx-profile确认已加载。
附带文件scripts/catalog.py
详细介绍
步骤 1 — 分析模板(pptx-profile)
将任意 .pptx 转换为一份实际版式地图,让后续步骤能精准定位版式。它回答了“我的模板实际包含哪些版式?每种版式适用于什么场景?”
STEP 1 — PROFILE STEP 2 — AUTHOR STEP 3 — RENDER
pptx-profile pptx-author pptx-from-layouts
─────────────── ─────────────── ─────────────────
your-template.pptx slides.md (+ [HINT:]) slides.md + config
│ │ │
▼ ▼ ▼
catalog.py ──catalog.md──▶ write & lint ──slides──▶ generate.py ─▶ deck.pptx
└────────────────── config.json ───────────────────▲ (validated)
"what layouts do I "write slides that "fill the template's
have?" name real layouts" actual placeholders"
你当前在:步骤 1。 输出将供步骤 2 和步骤 3 使用。
依赖项
Python 3.10+ 和 python-pptx(pip install python-pptx)。配置步骤会调用同一仓库中的同级 pptx-from-layouts 技能。
运行
python scripts/catalog.py /path/to/your-template.pptx \
--name your-template --output-dir ./build
这会在 ./build 中生成两个文件:
| 文件 | 面向对象 | 用途 |
|---|---|---|
your-template-layout-catalog.md | 你 / 步骤 2 的编写者 | 每种可提示版式的人类可读菜单:其 [HINT:] 名称、占位符及适用场景。 |
your-template-config.json | 步骤 3 的渲染引擎 | 功能 → 实际版式索引/名称的机器映射。传递给 generate.py --config。 |
选项:--catalog-only 会跳过配置文件(仅生成目录);--name 用于设置输出文件的基本名称(默认为文件名)。
目录内容
目录中的可提示版式表格只列出引擎知道如何填充的版式——其中的每个名称都是安全的 [HINT:] 值。折叠部分会列出文件中的所有原始版式,供参考。每行显示版式索引、可直接复制的精确提示名称、占位符(例如 picture、body、center-title),以及一句“适用场景”说明。
接下来
- **步骤 2 — 编写:**打开目录,使用每张幻灯片对应的
[HINT: layout_name]编写slides.md,然后运行pptx-author/scripts/lint_hints.py slides.md --config your-template-config.json进行检查。 - 步骤 3 — 渲染:
pptx-from-layouts/scripts/generate.py slides.md -o deck.pptx --template your-template.pptx --config your-template-config.json --validate。
说明
- **每个模板只需分析一次。**之后使用该模板制作的所有演示文稿,都可复用目录和配置。
- 附带的 Inner Chapter 模板已完成分析(见
templates/inner-chapter-config.json);如果跳过步骤 1,它就是默认模板。 - 如需全自动、符合品牌规范的入门配置(品牌颜色、字体、冒烟测试),可使用
pptx-template-onboarder子 Agent,它封装了此步骤。
评论
支持 Markdown