355b01b9dc49582428b8cb369d0f4ce5d2edb31e
DashiAI real HTML uses .imported-theme-root > .slide.imported-theme-slide, not .ppt-deck > .ppt-slide. Added as first priority selector, . ppt-deck kept as fallback for backward compatibility. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
html2pptx
HTML to editable PPTX export engine.
将 HTML 演示文稿导出为文字可编辑、布局可还原的 PPTX 文件。
原理
HTML 文件 → HTTP 服务 → Chrome headless 渲染 → DOM 遍历提取位置/样式 → pptxgenjs 生成 PPTX
依赖
- Node.js 18+
- Chrome / Chromium / Edge(用于渲染页面)
使用
# 安装
npm install
# 导出
node bin/html2pptx input.html output.pptx
核心依赖
| 包 | 用途 |
|---|---|
| playwright | 控制 Chrome headless 渲染页面 |
| pptxgenjs | 生成 PPTX 文件 |
| http-server | 本地静态文件服务(可选) |
License
MIT
Languages
JavaScript
93.6%
CSS
3.4%
HTML
3%