中文说明见下方,English version follows right after.
PPTskills 是一个面向 Codex 的 PPT 生成工具仓库,核心目标是把“生成 PPT”这件事做得更稳定、更可编辑、更适合持续迭代。
这个仓库目前提供两条主要路线:
HTML/CSS -> PPTX适合追求视觉还原度、复杂排版、网页式设计感。Schema JSON -> PPTX适合追求 PowerPoint 原生可编辑性、文字清晰度和版式稳定性。
仓库里还带了一个本地 Python 编辑器,以及一个可复用的 Codex skill,方便让 Codex 按统一规范产出 deck。
html2ppt/html2ppt/SKILL.mdCodex skill 说明,负责告诉 Codex 什么时候走 HTML 路线,什么时候走 schema 路线。html2ppt/html2ppt/scripts/html2ppt.pyHTML 导出 PPTX 的脚本,使用 Playwright 渲染并做导出前校验。html2ppt/html2ppt/scripts/schema2ppt.pySchema 导出 PPTX 的脚本,生成 PowerPoint 原生文本框、形状、线条、图片。html2ppt/html2ppt/scripts/deck_editor.py本地编辑器,支持 HTML deck 的预览、校验、保存和导出。html2ppt/html2ppt/scripts/searxng_research.py可选研究脚本,用于搜集事实、图片线索和研究素材。qin-unifies-six-states.html示例 HTML deck 源文件。qin-unifies-six-states.schema.json示例 schema deck 源文件。
适合这些情况:
- 需要高度还原设计稿
- 依赖复杂 CSS、SVG、网页式布局
- 最终更关注“交付效果”,而不是 PowerPoint 内部二次编辑
代价:
- 导出的 PPT 主要是图片化幻灯片,文本和图形不是原生可编辑对象
适合这些情况:
- 需要在 PowerPoint 里继续修改文案或布局
- 需要更清晰的文本和更稳定的模板结构
- 需要把标题、卡片、时间线、图形块做成原生对象
代价:
- 表现力会比纯 HTML/CSS 受限一些,但稳定性和可编辑性更好
当前支持的比例预设:
| 比例 | HTML 画布 | PPT 尺寸 |
|---|---|---|
16:9 |
1280x720 |
13.333 x 7.5 in |
4:3 |
1024x768 |
10 x 7.5 in |
16:10 |
1280x800 |
12 x 7.5 in |
3:2 |
1200x800 |
11.25 x 7.5 in |
1:1 |
1080x1080 |
7.5 x 7.5 in |
默认使用 16:9。
为了让生成更稳定,HTML deck 建议始终遵守这些规则:
- 一页幻灯片对应一个
section.slide - 每一页都按最终导出尺寸进行设计
- 明确设置
width、height、overflow: hidden - 使用统一的颜色、字号、间距 token
- 正文字号尽量保持在
22px到28px - 内容拥挤时拆页,不要强行塞进一页
详细规范见:
html2ppt/html2ppt/references/html-slide-contract.mdhtml2ppt/html2ppt/references/schema-slide-contract.md
建议使用 Python 3.11 或更高版本。
安装依赖:
python3 -m pip install -r requirements.txt安装 Playwright Chromium:
python3 -m playwright install chromiumpython3 html2ppt/html2ppt/scripts/html2ppt.py qin-unifies-six-states.html --ratio 16:9 --validate-only --strictpython3 html2ppt/html2ppt/scripts/html2ppt.py qin-unifies-six-states.html --out qin-unifies-six-states.pptx --ratio 16:9 --strict --render-scale 2如果你更在意清晰度,可以把 --render-scale 提高到 3,但文件会更大。
python3 html2ppt/html2ppt/scripts/schema2ppt.py qin-unifies-six-states.schema.json --out qin-unifies-six-states-native.pptxpython3 html2ppt/html2ppt/scripts/deck_editor.py qin-unifies-six-states.html --ratio 16:9这个编辑器适合:
- 边写 HTML/CSS 边预览
- 在导出前做规范校验
- 用统一模板快速起新 deck
可复用的 skill 位于:
html2ppt/html2ppt
它的作用包括:
- 根据需求自动选择 HTML 或 schema 工作流
- 统一管理幻灯片比例
- 约束 HTML/CSS 的设计规范
- 在需要可编辑 PPT 时优先走 schema 路线
- 在需要迭代时调用本地编辑器
这个仓库默认只提交“源文件”和“工具代码”,尽量不提交生成产物。
默认不建议提交的内容:
- 导出的
.pptx - 研究中间结果
research/*.json - 本地缓存和 Python 编译产物
这样仓库会更干净,也更适合作为工具库长期维护。
PPTskills is a Codex-oriented toolkit for generating PowerPoint decks in a way that is more stable, more editable, and easier to iterate on.
The repository currently supports two main workflows:
HTML/CSS -> PPTXBest when visual fidelity and expressive layout matter most.Schema JSON -> PPTXBest when native PowerPoint editability and layout stability matter most.
It also includes a lightweight local Python editor and a reusable Codex skill so Codex can generate decks under a consistent contract.
html2ppt/html2ppt/SKILL.mdCodex skill instructions for choosing between the HTML and schema workflows.html2ppt/html2ppt/scripts/html2ppt.pyHTML-to-PPTX exporter with Playwright rendering and pre-export validation.html2ppt/html2ppt/scripts/schema2ppt.pySchema-to-PPTX exporter that creates native PowerPoint text boxes, shapes, lines, and images.html2ppt/html2ppt/scripts/deck_editor.pyLocal editor for previewing, validating, saving, and exporting HTML decks.html2ppt/html2ppt/scripts/searxng_research.pyOptional research helper for collecting facts, references, and image leads.qin-unifies-six-states.htmlExample HTML deck source.qin-unifies-six-states.schema.jsonExample editable schema source.
Use this when you want:
- high visual fidelity
- expressive CSS, SVG, and web-style composition
- delivery-focused slides that look exactly as designed
Tradeoff:
- the exported PPT is mostly image-based, so text and shapes are not natively editable
Use this when you want:
- editable text and shapes inside PowerPoint
- crisp typography and stronger structural stability
- reusable presentation templates built from native objects
Tradeoff:
- the visual language is more constrained than free-form HTML/CSS
Supported ratio presets:
| Ratio | HTML canvas | PPT size |
|---|---|---|
16:9 |
1280x720 |
13.333 x 7.5 in |
4:3 |
1024x768 |
10 x 7.5 in |
16:10 |
1280x800 |
12 x 7.5 in |
3:2 |
1200x800 |
11.25 x 7.5 in |
1:1 |
1080x1080 |
7.5 x 7.5 in |
Default is 16:9.
For stable HTML deck generation, follow these rules:
- one slide per
section.slide - author every slide at final export size
- set explicit
width,height, andoverflow: hidden - use tokens for spacing, color, radius, and typography
- keep body text around
22pxto28px - split crowded slides instead of compressing them
Detailed contracts:
html2ppt/html2ppt/references/html-slide-contract.mdhtml2ppt/html2ppt/references/schema-slide-contract.md
Python 3.11+ is recommended.
Install dependencies:
python3 -m pip install -r requirements.txtInstall the Playwright Chromium runtime:
python3 -m playwright install chromiumpython3 html2ppt/html2ppt/scripts/html2ppt.py qin-unifies-six-states.html --ratio 16:9 --validate-only --strictpython3 html2ppt/html2ppt/scripts/html2ppt.py qin-unifies-six-states.html --out qin-unifies-six-states.pptx --ratio 16:9 --strict --render-scale 2Raise --render-scale to 3 if you want sharper screenshot-based output and accept a larger file.
python3 html2ppt/html2ppt/scripts/schema2ppt.py qin-unifies-six-states.schema.json --out qin-unifies-six-states-native.pptxpython3 html2ppt/html2ppt/scripts/deck_editor.py qin-unifies-six-states.html --ratio 16:9The editor is useful for:
- live HTML/CSS preview while editing
- contract validation before export
- bootstrapping new decks from a controlled template
The reusable skill lives at:
html2ppt/html2ppt
It helps Codex:
- choose the right workflow for the request
- keep slide ratios consistent
- enforce HTML/CSS design guardrails
- prefer the schema route when editability matters
- use the local editor for iterative deck work
This repository is intended to track source files and tooling, not generated artifacts.
By default, it should avoid committing:
- exported
.pptxfiles - intermediate research outputs in
research/*.json - local caches and Python build artifacts
That keeps the repository leaner and makes it easier to maintain as a toolkit.