Skip to content

hirokisakabe/pom

Repository files navigation

pom

AI-friendly PowerPoint generation with a Flexbox layout engine.

npm version License

pom (PowerPoint Object Model) is a TypeScript library that converts XML into editable PowerPoint files (.pptx).

Try it online — Playground

Playground


Features

  • AI Friendly — Simple XML structure designed for LLM code generation.
  • Declarative — Describe slides as XML. No imperative API calls needed.
  • Flexible Layout — Flexbox-style layout with VStack / HStack, powered by yoga-layout.
  • Rich Nodes — 18 built-in node types: charts, flowcharts, tables, timelines, org trees, and more.
  • Schema-validated — XML input is validated with Zod schemas at runtime with clear error messages.
  • PowerPoint Native — Full access to native PowerPoint shape features (roundRect, ellipse, arrows, etc.).

Quick Start

Requires Node.js 18+

npm install @hirokisakabe/pom
import { buildPptx } from "@hirokisakabe/pom";

const xml = `
<VStack w="100%" h="max" padding="48" gap="24" alignItems="start">
  <Text fontSize="48" bold="true">Presentation Title</Text>
  <Text fontSize="24" color="666666">Subtitle</Text>
</VStack>
`;

const { pptx } = await buildPptx(xml, { w: 1280, h: 720 });
await pptx.writeFile({ fileName: "presentation.pptx" });

Packages

This repository is a pnpm monorepo containing the following packages:

Package Description npm
packages/pom Core library — XML to PPTX conversion @hirokisakabe/pom
packages/pom-md Markdown to pom XML converter @hirokisakabe/pom-md
packages/pom-vscode VS Code extension for live preview Marketplace
apps/website Documentation website (pom.pptx.app)

Documentation

Document Description
API Reference buildPptx() function and options
Nodes Complete reference for all node types
Master Slide Headers, footers, and page numbers
Text Measurement Text measurement options and settings
llm.txt Compact XML reference for LLM prompts
Playground Try pom XML in the browser

License

MIT

About

AI-friendly PowerPoint generation with a Flexbox layout engine

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages