Skip to content

Instantly share code, notes, and snippets.

@mreider
Created March 23, 2026 08:40
Show Gist options
  • Select an option

  • Save mreider/dac3795e7ccf0d4c0cd6248e050cea83 to your computer and use it in GitHub Desktop.

Select an option

Save mreider/dac3795e7ccf0d4c0cd6248e050cea83 to your computer and use it in GitHub Desktop.

Here's what your friend needs to set up:

The workflow: Write slides in Markdown (Marp syntax), use Marp for previewing/presenting, then generate an editable PPTX separately when someone needs to edit slides in PowerPoint.

Why two steps: Marp's built-in PPTX export renders slides as images, so nothing is editable. You need a separate tool to produce native PowerPoint elements.

What to install:

  • Marp CLI (@marp-team/marp-cli) for previewing, presenting, and exporting to HTML/PDF. This is the authoring and presentation side.
  • Node.js + pptxgenjs (pptxgenjs) for generating the editable PPTX. This is what builds real text boxes, tables, and shapes that PowerPoint can edit.
  • A build script (JavaScript) that reads your Marp markdown content and translates it into pptxgenjs API calls. This is the custom glue. There's no off-the-shelf converter that does this, so you write a script tailored to your slide theme and structure.

How it works in practice:

  1. Author slides in Markdown with Marp frontmatter and styling
  2. Preview/present using marp --preview or export to HTML/PDF
  3. When an editable PPTX is needed, run your Node.js build script
  4. The script recreates each slide using pptxgenjs with matching colors, fonts, layout, and content

The tradeoff: The build script is manual work upfront. You're essentially mapping your Marp theme (backgrounds, title styles, code blocks, tables) to pptxgenjs equivalents. Once the theme is built, adding new slides with existing patterns is straightforward. But if you change the Marp theme significantly, you update the script too.

Alternative if he wants less custom code: Use Pandoc (pandoc -t pptx) with a reference template. It handles basic markdown-to-editable-PPTX out of the box but gives you less control over styling than pptxgenjs does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment