abs-slidekit
v1.4.1
Published
Presentation rendering and export API
Readme
abs-slidekit
Node.js engine for abs-slidekit — renders JSON presentations to PPTX.
Install
npm install abs-slidekitRequires Node ≥ 18.
Usage
import { render, applyData, extractSchema } from 'abs-slidekit'
// Optionally merge dynamic data into a template first…
const filled = applyData(presentation, bindings, data)
// …then render to a PPTX Buffer.
const pptxBuffer = await render(filled, { format: 'pptx' })API
render(presentation, options?) → Promise<Buffer>— renders a presentation to a.pptxBuffer.options.formatmust be'pptx'('pdf'/'image'are not yet implemented).options.themeoverridespresentation.theme. Throws ifpresentation.slidesis not an array.applyData(presentation, bindings, data) → presentation— returns a new (deep-cloned) presentation withdatamerged in per thebindingsmap. Does not mutate inputs.extractSchema(bindings) → { schema: [{ key, type, … }] }— returns the deduplicated set ofdatakeys a bindings map requires.resolveLayout(presentation) → presentation— compiles flexbox-stylelayoutcontainer elements into absolutely-positioned groups. Called automatically byrender(); exported for standalone use (e.g. validation/preview).validate(presentation, options?, bindings?) → { valid, errors, warnings }— static, render-free checks: duplicate ids, out-of-bounds, overlap, empty size, unknown types, and (withbindings) dangling binding refs. See FORMAT.md §2.
Documentation
- docs/FORMAT.md — complete presentation format reference: elements, styles, coordinate system, data bindings, themes, examples, and current limits.
- docs/schema/ — JSON Schemas for machine validation (and for programmatic/LLM authoring):
Concepts at a glance
| Input | Shape | Purpose |
|-------|-------|---------|
| presentation | { meta?, theme?, slides[] } | The deck. Coordinates are pixels (96px = 1in), origin top-left. |
| bindings | map keyed by element id | Declares which elements are dynamic and how data fills them. |
| data | plain object | Values referenced by bindings[*].key. |
Element types: text, shape, image, line, table, chart, group, layout (flexbox-style auto-arrangement — see FORMAT.md §5).
Binding types: text, image, chart, repeat (+ table, see the caveat in FORMAT.md §5).
Built-in themes: corporate-blue (default), minimal-white, dark-professional, warm-creative, high-contrast.
Testing
npm test