Kai Export PPT Lite

Other

Export HTML presentations to editable PPTX slides using pure Python without browser dependencies, ideal for sandbox environments and limited runtimes.

Install

openclaw skills install kai-export-ppt-lite

kai-export-ppt-lite

Export HTML presentations to editable PPTX without a browser. Pure Python — no Playwright, no Chrome, no Node.js.

Commands

CommandWhat it does
python3 <skill-path>/scripts/export-sandbox-pptx.py <file.html> [output.pptx] [--width 1440] [--height 900]Canonical entrypoint; works as a real file or as inline-retrieved script
python3 <skill-path>/scripts/run-skill-export.py <file.html> [output.pptx] [--width 1440] [--height 900]Optional tiny bootstrap when the runtime exposes a real installed skill directory

Dependencies

PackageInstall
beautifulsoup4Usually auto-installed by skill metadata or pip install beautifulsoup4
lxmlUsually auto-installed by skill metadata or pip install lxml
python-pptxUsually auto-installed by skill metadata or pip install python-pptx
PillowUsually auto-installed by skill metadata or pip install Pillow

Usage

python3 <skill-path>/scripts/export-sandbox-pptx.py <file.html> [output.pptx] [--width 1440] [--height 900]

Local repo execution remains available:

python3 scripts/export-sandbox-pptx.py <file.html> [output.pptx] [--width 1440] [--height 900]

Sandbox Execution

Do not assume anything about the agent runtime. This skill must tolerate:

  • no stable skill root path
  • no __file__
  • notebook / cell-style inline execution
  • dependencies either preinstalled or missing

When this skill runs inside a hosted sandbox, use this decision order:

  1. Default path: retrieve and execute scripts/export-sandbox-pptx.py.
  2. If the runtime exposes a real installed skill directory, you may instead call:
    python3 <skill-path>/scripts/export-sandbox-pptx.py input.html output.pptx
    
  3. If the runtime only supports inline Python execution, retrieve scripts/export-sandbox-pptx.py and inline it directly.
  4. Pass the HTML input via the sandbox VFS/attachment mechanism and write the PPTX to the sandbox artifact directory.
  5. Let the script self-bootstrap dependencies first. Skill metadata / requirements.txt are optimizations, not assumptions.
  6. scripts/run-skill-export.py is an optional optimization only. Do not require it for correctness.

Why this is the stable path

  • scripts/export-sandbox-pptx.py is the only execution surface that does not require assuming a skill root, env var, or installer-specific layout.
  • The exporter now tolerates missing __file__, degrades when vendored contracts/ are absent, and attempts runtime dependency bootstrap before failing.
  • run-skill-export.py remains useful when the environment is richer, but it is not part of the correctness boundary.
  • If vendored contracts/ are unavailable, export still runs; only preset-specific fidelity hints degrade.

Prohibited patterns

  • assuming an installed skill directory exists
  • assuming __file__ exists in notebook / cell-based sandboxes
  • assuming build-time dependency installation always happened
  • making run-skill-export.py the only supported path

Options

FlagDescription
--width NSlide width in pixels (default: 1440)
--height NSlide height in pixels (default: 900)
--with-chromeAdd page counter and nav dots

What it extracts

HTML ElementPPTX Output
h1-h6, p, li, spanEditable text boxes
div with background/borderRounded rectangles with fill
table, tr, td, thCell rectangles with text frames
img (http/file/data-uri)Embedded pictures
svgPlaceholder rectangle

Limitations (no browser)

  • CSS variables: only :root static substitution
  • Layout: simulated flex-column, not pixel-perfect
  • Computed styles: unavailable, relies on inline style + <style> blocks
  • JavaScript: not executed, so IntersectionObserver-gated content won't appear

Comparison

kai-html-export (full)kai-export-ppt-lite
RuntimePlaywright + ChromePure Python
Sandbox compatible
Output qualityPixel-perfectSemantic layout
Editable text
Image mode PPTX✅ (screenshot)
Dependenciesplaywright, python-pptxbs4, lxml, python-pptx, Pillow