oldliandClaude Sonnet 5 ca1e4dfa72 PM: html2pptx v3 - fix slide detection to direct children only
- deck.querySelectorAll('.ppt-slide') -> deck.querySelectorAll(':scope > .ppt-slide')
  prevents nested .ppt-slide elements from being counted as separate slides
- Enhanced visibility filter: check opacity, display, visibility in addition to rect size
- Tested: dashi-deck.html now returns 14 slides (was 20), simple.html returns 10

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-22 20:17:39 +08:00

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

S
Description
HTML to editable PPTX export engine
Readme
741 KiB
Languages
JavaScript 93.6%
CSS 3.4%
HTML 3%