{"_id":"@0-ai/slide-gen","_rev":"3-56d169a619b04638580d6146a967031a","name":"@0-ai/slide-gen","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@0-ai/slide-gen","version":"0.1.0","keywords":["slides","pptx","powerpoint","pdf","html-to-pptx","presentation","converter","bun"],"license":"MIT","_id":"@0-ai/slide-gen@0.1.0","maintainers":[{"name":"anton_horn","email":"antonhorn@icloud.com"}],"homepage":"https://github.com/0-AI-UG/slide-gen","bugs":{"url":"https://github.com/0-AI-UG/slide-gen/issues"},"bin":{"slide-gen":"src/cli.ts"},"dist":{"shasum":"b97847f8f2caab6558c7f10007922ac9ac322f6f","tarball":"https://registry.npmjs.org/@0-ai/slide-gen/-/slide-gen-0.1.0.tgz","fileCount":25,"integrity":"sha512-DXXc0vo+E929XyGm0Ntc2G3VL5sa007h14yknTWcB11SCXU+/s1nWoqNjKWhQMTVqxD1YB8ObpYV9ydpy6YOvQ==","signatures":[{"sig":"MEUCID/mCGm9cPYSKcFyFpLgVNkprRTwv54Izs07+WGvTLmMAiEA7DAjOyyDL/vtlTb6KMK//SRcB61pPDKx/jfz5ioukfU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":128356},"main":"src/index.ts","type":"module","types":"src/index.ts","exports":{".":"./src/index.ts"},"gitHead":"2d6998f83d533be5b511545b5c08f375ec0a921f","scripts":{"cli":"bun run src/cli.ts","test":"bun test","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anton_horn","email":"antonhorn@icloud.com"},"repository":{"url":"git+https://github.com/0-AI-UG/slide-gen.git","type":"git"},"_npmVersion":"11.6.0","description":"Convert HTML slide decks to PPTX, PDF, and PNG","directories":{},"_nodeVersion":"24.10.0","dependencies":{"jszip":"^3.10.1","playwright":"^1.52.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.10","typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/slide-gen_0.1.0_1774625613366_0.7150817878512687","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@0-ai/slide-gen","version":"0.1.1","keywords":["slides","pptx","powerpoint","pdf","html-to-pptx","presentation","converter","bun"],"license":"MIT","_id":"@0-ai/slide-gen@0.1.1","maintainers":[{"name":"anton_horn","email":"antonhorn@icloud.com"}],"homepage":"https://github.com/0-AI-UG/slide-gen","bugs":{"url":"https://github.com/0-AI-UG/slide-gen/issues"},"bin":{"slide-gen":"src/cli.ts"},"dist":{"shasum":"e7f38e3fd61bda581b1a52094e5dfdbdce4e6af4","tarball":"https://registry.npmjs.org/@0-ai/slide-gen/-/slide-gen-0.1.1.tgz","fileCount":29,"integrity":"sha512-g4xvROiydSj4EXj9HisrXnbasvTfCbnB0dSkFGiugomAXrAf3jI1dD1Exq+SmTWG2ck0VZ+EjeO69/6ipduDRw==","signatures":[{"sig":"MEMCHzg0FQVFm51gAtn0w1xx7tURCCGuC0ks+QfzqKhuDuQCIEVhY0fsql6x9BqBJBh+KQ2R341YClVj6p7kIhp8xRMe","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@0-ai%2fslide-gen@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":190881},"main":"src/index.ts","type":"module","types":"src/index.ts","exports":{".":"./src/index.ts"},"gitHead":"1477eb1910edb2ca64c86d845090e7a83c27f970","scripts":{"cli":"bun run src/cli.ts","test":"bun test","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2e43973a-d591-4352-8b5b-dd455bbf3e86"}},"repository":{"url":"git+https://github.com/0-AI-UG/slide-gen.git","type":"git"},"_npmVersion":"11.12.1","description":"Convert HTML slide decks to PPTX, PDF, and PNG","directories":{},"_nodeVersion":"22.22.1","dependencies":{"jszip":"^3.10.1","playwright":"^1.52.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.10","typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/slide-gen_0.1.1_1774696632332_0.5196795341264033","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@0-ai/slide-gen","version":"0.1.2","description":"Convert HTML slide decks to PPTX, PDF, and PNG","license":"MIT","type":"module","main":"src/index.ts","types":"src/index.ts","exports":{".":"./src/index.ts"},"bin":{"slide-gen":"src/cli.ts"},"scripts":{"test":"bun test","typecheck":"tsc --noEmit","cli":"bun run src/cli.ts"},"keywords":["slides","pptx","powerpoint","pdf","html-to-pptx","presentation","converter","bun"],"repository":{"type":"git","url":"git+https://github.com/0-AI-UG/slide-gen.git"},"homepage":"https://github.com/0-AI-UG/slide-gen","dependencies":{"jszip":"^3.10.1","playwright":"^1.52.0"},"devDependencies":{"@types/bun":"^1.3.10","typescript":"^5.9.3"},"gitHead":"631c7a249e70e547718c24628500f4aae5856386","_id":"@0-ai/slide-gen@0.1.2","bugs":{"url":"https://github.com/0-AI-UG/slide-gen/issues"},"_nodeVersion":"22.22.1","_npmVersion":"11.12.1","dist":{"integrity":"sha512-41i4jNC0r80CJO3kWdhI1d3eAOhBGWEjlD6e94XoCczwjEMvaIYReWoazdsSctPkiToycFQTagVjQkHjxdJPbg==","shasum":"d919304c3d0f46e8dd36ed52219d947709e24536","tarball":"https://registry.npmjs.org/@0-ai/slide-gen/-/slide-gen-0.1.2.tgz","fileCount":29,"unpackedSize":191055,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@0-ai%2fslide-gen@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHkXr7rB+V+drK3XCarsj+UA/KLiE4LxL0HLZLqAyzIJAiBk+Za8zZAjC5BKSmUPfkUKVDsGo7yL6jtjrQolqOAvyQ=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2e43973a-d591-4352-8b5b-dd455bbf3e86"}},"directories":{},"maintainers":[{"name":"anton_horn","email":"antonhorn@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/slide-gen_0.1.2_1774698407107_0.024452955386880637"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-27T15:33:33.307Z","modified":"2026-03-28T11:46:47.589Z","0.1.0":"2026-03-27T15:33:33.546Z","0.1.1":"2026-03-28T11:17:12.497Z","0.1.2":"2026-03-28T11:46:47.268Z"},"bugs":{"url":"https://github.com/0-AI-UG/slide-gen/issues"},"license":"MIT","homepage":"https://github.com/0-AI-UG/slide-gen","keywords":["slides","pptx","powerpoint","pdf","html-to-pptx","presentation","converter","bun"],"repository":{"type":"git","url":"git+https://github.com/0-AI-UG/slide-gen.git"},"description":"Convert HTML slide decks to PPTX, PDF, and PNG","maintainers":[{"name":"anton_horn","email":"antonhorn@icloud.com"}],"readme":"# slide-gen\n\nConvert HTML slide decks to PPTX, PDF, and PNG. Design your slides with HTML + CSS, then export to native PowerPoint format with high-fidelity conversion.\n\n## How it works\n\nslide-gen renders your HTML in a headless Chromium browser (via Playwright), extracts every visible element from the DOM — shapes, text runs, images, gradients — and reconstructs them as native OOXML objects inside a `.pptx` file. The result is a real PowerPoint file with editable text, not a rasterized image.\n\n## Requirements\n\n- [Bun](https://bun.sh) >= 1.0\n- Playwright Chromium (`bunx playwright install chromium`)\n- **Optional:** LibreOffice + Ghostscript (only for `--render` PPTX verification)\n\n## Install\n\n```bash\nbun add @0-ai/slide-gen\n```\n\n## CLI usage\n\n```bash\nbunx slide-gen slides.html -o ./output\n```\n\nThis generates `presentation.pptx`, `presentation.pdf`, and `slide-*.png` files in the output directory.\n\n### Options\n\n```\n-o, --output-dir <dir>   Output directory (default: ./output)\n--no-pdf                 Skip PDF generation\n--no-pptx                Skip PPTX generation\n--no-png                 Skip PNG screenshots\n--render                 Render PPTX back to PNG via LibreOffice (for verification)\n--skip-fonts             Use previously cached fonts\n--fonts-dir <dir>        Custom fonts cache directory\n```\n\n## API usage\n\n### File-based pipeline\n\nReads HTML from disk, writes outputs to a directory:\n\n```typescript\nimport { convertHtmlToSlides } from \"@0-ai/slide-gen\";\n\nconst result = await convertHtmlToSlides(\"slides.html\", {\n  outputDir: \"./output\",\n  onProgress: console.log,\n});\n\nconsole.log(result.pptxPath);  // ./output/presentation.pptx\nconsole.log(result.pdfPath);   // ./output/presentation.pdf\nconsole.log(result.pngPaths);  // [\"./output/slide-1.png\", ...]\n```\n\n### Buffer-based pipeline\n\nAccepts HTML as a string, returns everything as in-memory buffers — no output directory needed:\n\n```typescript\nimport { convertHtmlBuffers } from \"@0-ai/slide-gen\";\n\nconst result = await convertHtmlBuffers({\n  html: \"<html>...</html>\",\n  noPdf: true,   // skip PDF\n  noPng: true,   // skip PNGs\n});\n\n// result.pptxBuffer — Buffer containing the .pptx file\n// result.pngBuffers — Buffer[] of slide screenshots\n// result.slideData  — extracted slide structure\n```\n\n### Low-level API\n\nUse individual pipeline stages directly:\n\n```typescript\nimport {\n  launchBrowser,\n  loadHtmlContent,\n  extractSlideData,\n  prepareFontsFromSlideData,\n  buildPptx,\n  generatePdfBuffer,\n  generateSlidePngBuffers,\n  closeBrowser,\n} from \"@0-ai/slide-gen\";\n```\n\n## HTML slide format\n\nEach slide is a `<div class=\"slide\">` element sized at 1920x1080px:\n\n```html\n<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"UTF-8\" />\n  <meta name=\"viewport\" content=\"width=1920, initial-scale=1\" />\n  <style>\n    @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');\n\n    *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }\n\n    body { background: #000; }\n\n    .slide {\n      position: relative;\n      width: 1920px;\n      height: 1080px;\n      overflow: hidden;\n      font-family: 'Inter', sans-serif;\n      color: #fff;\n      background: #0a0a0a;\n    }\n    .slide + .slide { page-break-before: always; }\n  </style>\n</head>\n<body>\n  <div class=\"slide\">\n    <h1 style=\"padding: 80px; font-size: 64px;\">Hello, World</h1>\n  </div>\n  <div class=\"slide\">\n    <h1 style=\"padding: 80px; font-size: 64px;\">Slide Two</h1>\n  </div>\n</body>\n</html>\n```\n\n## Supported CSS\n\n| Feature | Notes |\n|---|---|\n| Solid backgrounds | `background-color` on any element |\n| Linear & radial gradients | `linear-gradient()`, `radial-gradient()` |\n| Flexbox & Grid layouts | Positions captured via `getBoundingClientRect()` |\n| Google Fonts | All weights (100-900) — auto-downloaded and embedded |\n| Borders | Per-side colors and widths (>=1px) |\n| `border-radius` | Uniform value (not per-corner) |\n| Opacity | Accumulated from ancestor chain |\n| CSS variables | Resolved by the browser before extraction |\n| `transform: rotate()` | Only rotation — no scale/skew/translate |\n| `::before` / `::after` | Position, size, background only (no text) |\n| Font styling | size, weight, style, family, color, letter-spacing, line-height |\n| Text formatting | text-transform, text-align |\n| `<img>`, inline SVG | Rasterized and embedded as PNG |\n| `background-image: url()` | Single image backgrounds |\n| `writing-mode` | `vertical-rl`/`vertical-lr` |\n\n### Data attributes\n\nControl conversion behavior with these attributes:\n\n| Attribute | Values | Purpose |\n|---|---|---|\n| `data-sg-wrap` | `\"true\"` / `\"false\"` | Explicit text wrapping control |\n| `data-sg-group` | any string | Group text runs into a single PPTX text box |\n\n### Not supported (silently ignored)\n\nShadows, filters, backdrop-filter, clip-path, text-decoration, transforms other than `rotate()`, conic gradients, multiple background layers, per-corner border-radius, positioned layout offsets.\n\n## Fonts\n\nGoogle Fonts are automatically downloaded, cached locally (in `.slide-gen-fonts/`), and embedded into the PPTX file. System fonts work but only get binary bold — no weight variants.\n\nUse `--skip-fonts` on subsequent runs to reuse the cached fonts.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}