oldliandClaude Sonnet 5 ec7a44d6fb refactor: complete three-layer serial refactoring (knowledge→schema→renderer)
Step 1 — Knowledge base: perfect all reference/*.md with type, range, default, unit
- text.md: add DataOrPathProps, path/data, bullet deprecated params
- chart.md: add deprecated section, fix 19 params with missing elements
- slide.md: add bkgd→background deprecated mapping
- output.md: add masterSlide, presLayout

Step 2 — Schema: align schema/presentation.schema.json with KB
- Add catAxisItem and valAxisItem definitions with full sub-property constraints
- Fix 7 enum constraints (barDir, displayBlanksAs, bar3DShape, etc.)
- Add 4 missing fields (verbose, autoPageCharWeight, autoPageLineWeight, notes,
  masterSlide, presLayout)

Step 3 — Translation engine: transform renderers from passthrough to validation
- index.js: add normalizePosition, normalizeColor, validateEnum shared utilities
- All renderers: position validation, color hex normalization, enum validation
- Image: graceful failure handling (catch load errors, warn, continue)
- Chart: chartType enum validation, data parity check
- Table: colspan/rowspan integer validation, border array check
- Full verification: basic.json and full.json generate valid PPTX

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-23 13:10:01 +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%