Skip to content

Convert PPTX to localizable positioned HTML - #1

Merged
ivorb merged 10 commits into
mainfrom
ivorb-pptx-to-html-localization
Nov 4, 2026
Merged

ivorb merged 10 commits into
mainfrom
ivorb-pptx-to-html-localization

Conversation

@ivorb

@ivorb ivorb commented Nov 4, 2026

Copy link
Copy Markdown
Owner

What

A new path from .pptx to HTML that keeps every word as real, translatable text and does a best-effort job on layout. The existing Markdown importer is untouched.

  • Converter (tools/pptx-html.mjs, with xml-lite, pptx-style, pptx-geom): one fixed canvas per slide; shapes placed from the PPTX geometry (layout/master inheritance, group scale/rotate/flip, presets and custom shapes, connectors with arrowheads, gradients, cropped pictures, tables, SmartArt via its stored drawing).
  • Localization contract (docs/string-table.md): every paragraph, speaker note and alt text gets a stable ID in strings.json; slides carry data-i18n. Code (monospace) paragraphs stay on the slide but are not in the table.
  • Browser page (convert.html): drop a .pptx, preview it, browse the generated HTML and string table, see what was skipped, download a single HTML file or the deck folder (ZIP). Nothing is uploaded.
  • Viewer: deck.html and the standalone file support ?lang=<code> (strings are rebuilt from allowed tags only). Longer text shrinks to fit its box (floor 60%); &review outlines boxes that still overflow.
  • Build: HTML decks are supported by build-manifest and build-site; standalone files embed each picture once.
  • Workflow: PDF export (serve, export, upload) now only runs from a manual run with export_pdfs ticked. Code is untouched.
  • CLI: node tools/pptx-to-html.mjs deck.pptx --slug my-talk.

Checked

Against four real decks (59/55/44/44 slides, groups, connectors, code, tables, notes): all 2,965 text paragraphs in the source appear in the output (whitespace-insensitive check, hidden shapes excluded), and the output was reviewed visually in the browser, including with a pseudo-translation 45% longer than the source. node --test tests/ passes (9 tests). Existing Markdown decks still render.

Known limits

  • Text inside pictures can't be translated.
  • Charts show as a placeholder; EMF/WMF pictures can't be shown (both are listed under "Needs a look").
  • No animations, transitions or shadow effects. Unusual presets are drawn as rectangles.
  • Only the first run's color/size per paragraph is kept when runs differ; bold/italic/underline/links/code spans are kept as tags.
  • SmartArt rendering is implemented but untested (none of the sample decks had any).
  • Layout/master text repeats per slide in the string table (s<n>.L. / s<n>.M. IDs).
  • import.html and convert.html duplicate some UI code.

Not in this PR

The translate CLI (tools/translate.mjs) is being built separately against the same contract.

ivorb added 7 commits November 4, 2026 14:05
Adds a converter that turns a .pptx into fixed-canvas HTML with every paragraph,
note and alt text in a string table (docs/string-table.md), a browser page to
convert, preview and download, standalone single-file output with embedded
translations, fit-to-box for longer text, and gates PDF export behind a manual
workflow input.
@ivorb
ivorb marked this pull request as ready for review November 4, 2026 20:07
@ivorb
ivorb merged commit 3c967bb into main Nov 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant