# pptx-to-html

Convert PowerPoint decks into single, self-contained HTML viewers. Each slide
is rendered to a high-resolution image by PowerPoint itself and embedded as
base64, so the result is one portable `.html` file that mirrors the deck's
formatting and page structure, named to match the source.

Handles modern `.pptx`/`.pptm` and legacy binary `.ppt` (OLE2) files, including
decks that are secretly `.ppt` behind a `.pptx` extension.

## Quick start

```powershell
python "C:\Users\<you>\.copilot\m-skills\pptx-to-html\convert.py" `
  --input "C:\path\to\deck.pptx"
```

Writes `deck.html` next to the source and prints a JSON summary.

## Options

| Flag              | Purpose                                                        |
| ----------------- | ------------------------------------------------------------- |
| `--input`         | Source deck. Repeat the flag to convert multiple files.       |
| `--input-dir`     | Convert every `.pptx`/`.ppt`/`.pptm` in a folder (non-recursive). |
| `--out`           | Output directory (default: next to each source file).         |
| `--scale`         | Render scale, default `2.0` (1920x1080/slide). Higher = crisper, larger. |
| `--titles`        | JSON file mapping slide number -> nav label, to override auto-derived labels. |
| `--processed-dir` | Move each source deck here after a successful conversion.      |
| `--skip-existing` | Skip a deck whose `.html` already exists (safe resume).       |

For many or large decks, use the robust folder driver `batch.py`, which converts
each file in its own subprocess under a per-file `--timeout` (a hung deck is
isolated and skipped) and supports the same `--processed-dir` / `--skip-existing`:

```powershell
python "C:\Users\<you>\.copilot\m-skills\pptx-to-html\batch.py" `
  --input-dir "C:\path\Raw" --out "C:\path\Output" `
  --processed-dir "C:\path\Raw\Processed" `
  --log "C:\path\batch.log" --result "C:\path\summary.json" --skip-existing
```

## Output features

- Navy header (deck name + date if the filename starts with `YYYY.MM.DD`).
- Sidebar table of contents with scroll-spy; click to jump to a slide.
- One 16:9 framed slide per page, numbered `N / total`.
- Keyboard navigation, back-to-top button, print-to-PDF friendly.
- Blank source slides render as clean white "(blank)" frames.

## Behavior

- Move-on-success only: a deck that errors or times out stays in place for retry.
- Source scan is non-recursive, so a `Processed` subfolder is never re-ingested.
- OneDrive cloud files are hydrated via a temp copy before rendering.

## Requirements

Windows + Microsoft PowerPoint + Python 3.12 with `pywin32`. No LibreOffice.

See `SKILL.md` for the full agent workflow, QA guidance, and edge cases.
