pptx-ts 3.7.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/README.md +116 -269
  2. package/dist/autopage-odPz7zZO.js +536 -0
  3. package/dist/autopage-odPz7zZO.js.map +1 -0
  4. package/dist/binary-string-CKVAYI3M.js +24 -0
  5. package/dist/binary-string-CKVAYI3M.js.map +1 -0
  6. package/dist/body-insets-Dw_BeWD_.js +54 -0
  7. package/dist/body-insets-Dw_BeWD_.js.map +1 -0
  8. package/dist/browser.d.ts +29 -9
  9. package/dist/browser.d.ts.map +1 -1
  10. package/dist/browser.js +41 -14
  11. package/dist/browser.js.map +1 -1
  12. package/dist/clip-Bl01BPcN.d.ts +67 -0
  13. package/dist/clip-Bl01BPcN.d.ts.map +1 -0
  14. package/dist/diagnostics-D8ot4Ei7.d.ts +244 -0
  15. package/dist/diagnostics-D8ot4Ei7.d.ts.map +1 -0
  16. package/dist/embedded-fonts-DarT9aoa.d.ts +20 -0
  17. package/dist/embedded-fonts-DarT9aoa.d.ts.map +1 -0
  18. package/dist/entry-compose-DCnvBZz2.d.ts +1046 -0
  19. package/dist/entry-compose-DCnvBZz2.d.ts.map +1 -0
  20. package/dist/{enums-CvRYniUA.d.ts → enums-BUKTUB6V.d.ts} +21 -13
  21. package/dist/{enums-CvRYniUA.d.ts.map → enums-BUKTUB6V.d.ts.map} +1 -1
  22. package/dist/{errors-Bvln0H-7.js → errors-C4oENPcu.js} +92 -2
  23. package/dist/errors-C4oENPcu.js.map +1 -0
  24. package/dist/families.d.ts +260 -0
  25. package/dist/families.d.ts.map +1 -0
  26. package/dist/families.js +57 -0
  27. package/dist/families.js.map +1 -0
  28. package/dist/{fit-BKs0zxMI.js → fit-Cb7naFj6.js} +249 -167
  29. package/dist/fit-Cb7naFj6.js.map +1 -0
  30. package/dist/font-metrics-v5fn7s7e.d.ts +613 -0
  31. package/dist/font-metrics-v5fn7s7e.d.ts.map +1 -0
  32. package/dist/grid-DikTjFey.js +187 -0
  33. package/dist/grid-DikTjFey.js.map +1 -0
  34. package/dist/{html-dom-B0I0QSbU.js → html-dom-Iuog2wdK.js} +121 -91
  35. package/dist/html-dom-Iuog2wdK.js.map +1 -0
  36. package/dist/html.d.ts +6 -6
  37. package/dist/html.d.ts.map +1 -1
  38. package/dist/html.js +7 -6
  39. package/dist/html.js.map +1 -1
  40. package/dist/image-size-CvN2iCA4.js +1611 -0
  41. package/dist/image-size-CvN2iCA4.js.map +1 -0
  42. package/dist/index.d.ts +24 -10
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +31 -11
  45. package/dist/index.js.map +1 -1
  46. package/dist/inspect.d.ts +40 -31
  47. package/dist/inspect.d.ts.map +1 -1
  48. package/dist/inspect.js +40 -48
  49. package/dist/inspect.js.map +1 -1
  50. package/dist/math.d.ts +7 -5
  51. package/dist/math.d.ts.map +1 -1
  52. package/dist/math.js +16 -7
  53. package/dist/math.js.map +1 -1
  54. package/dist/measure.d.ts +12 -225
  55. package/dist/measure.d.ts.map +1 -1
  56. package/dist/measure.js +3 -3
  57. package/dist/node.d.ts +22 -8
  58. package/dist/node.d.ts.map +1 -1
  59. package/dist/node.js +27 -7
  60. package/dist/node.js.map +1 -1
  61. package/dist/notes-Dh12JAbn.js +3264 -0
  62. package/dist/notes-Dh12JAbn.js.map +1 -0
  63. package/dist/options-internal-WqgMf720.js +43 -0
  64. package/dist/options-internal-WqgMf720.js.map +1 -0
  65. package/dist/{package-CaOLXSNi.d.ts → package-J49Ck6S2.d.ts} +27 -12
  66. package/dist/package-J49Ck6S2.d.ts.map +1 -0
  67. package/dist/playbtn-CUqQdoDf.js +22 -0
  68. package/dist/playbtn-CUqQdoDf.js.map +1 -0
  69. package/dist/{slide-ZqAdVvHV.d.ts → pres-C6qgOFAa.d.ts} +1021 -1423
  70. package/dist/pres-C6qgOFAa.d.ts.map +1 -0
  71. package/dist/{presentation-DrJtj3-C.js → presentation-DGYlAWhl.js} +3208 -2727
  72. package/dist/presentation-DGYlAWhl.js.map +1 -0
  73. package/dist/{presentation-types-CDjScsev.d.ts → presentation-types-8jLQHI4M.d.ts} +1070 -683
  74. package/dist/presentation-types-8jLQHI4M.d.ts.map +1 -0
  75. package/dist/read.d.ts +9 -9
  76. package/dist/read.d.ts.map +1 -1
  77. package/dist/read.js +4 -4
  78. package/dist/script.d.ts +80 -66
  79. package/dist/script.d.ts.map +1 -1
  80. package/dist/script.js +2399 -1139
  81. package/dist/script.js.map +1 -1
  82. package/dist/{shapes-BemroU-z.js → shapes-re0KyQk_.js} +2807 -1609
  83. package/dist/shapes-re0KyQk_.js.map +1 -0
  84. package/dist/slide-Dx2ZeVZ6.d.ts +1256 -0
  85. package/dist/slide-Dx2ZeVZ6.d.ts.map +1 -0
  86. package/dist/slide-size-BalTjFuv.js +88 -0
  87. package/dist/slide-size-BalTjFuv.js.map +1 -0
  88. package/dist/{units-internal-Dg95w_YD.js → table-cell-margins-EVg0EwxT.js} +235 -273
  89. package/dist/table-cell-margins-EVg0EwxT.js.map +1 -0
  90. package/dist/table-dom-BTDP3lEP.js +21 -0
  91. package/dist/table-dom-BTDP3lEP.js.map +1 -0
  92. package/dist/text-KnLOtEEu.js +3980 -0
  93. package/dist/text-KnLOtEEu.js.map +1 -0
  94. package/dist/text-anchor-CrYXAfUu.js +176 -0
  95. package/dist/text-anchor-CrYXAfUu.js.map +1 -0
  96. package/dist/transition-speed-kUEWDWTx.js +14 -0
  97. package/dist/transition-speed-kUEWDWTx.js.map +1 -0
  98. package/dist/units-internal-XJlf-hOl.js +649 -0
  99. package/dist/units-internal-XJlf-hOl.js.map +1 -0
  100. package/dist/zip-C0leZZMj.d.ts +67 -0
  101. package/dist/zip-C0leZZMj.d.ts.map +1 -0
  102. package/dist/zip-CKd8ihcf.js +177 -0
  103. package/dist/zip-CKd8ihcf.js.map +1 -0
  104. package/dist/zip.d.ts +3 -68
  105. package/dist/zip.js +3 -163
  106. package/dist/zoom-cX9sllpH.js +8865 -0
  107. package/dist/zoom-cX9sllpH.js.map +1 -0
  108. package/package.json +106 -19
  109. package/skills/ts-pptx-upstream/SKILL.md +58 -57
  110. package/dist/autopage-DkjYZUFD.js +0 -423
  111. package/dist/autopage-DkjYZUFD.js.map +0 -1
  112. package/dist/diagnostics-DfBdDHre.d.ts +0 -829
  113. package/dist/diagnostics-DfBdDHre.d.ts.map +0 -1
  114. package/dist/errors-Bvln0H-7.js.map +0 -1
  115. package/dist/errors-PflMPWBn.d.ts +0 -182
  116. package/dist/errors-PflMPWBn.d.ts.map +0 -1
  117. package/dist/fit-BKs0zxMI.js.map +0 -1
  118. package/dist/html-dom-B0I0QSbU.js.map +0 -1
  119. package/dist/namespaces-BVnNu7sg.js +0 -666
  120. package/dist/namespaces-BVnNu7sg.js.map +0 -1
  121. package/dist/notes-CJFJaG6M.js +0 -1724
  122. package/dist/notes-CJFJaG6M.js.map +0 -1
  123. package/dist/package-CaOLXSNi.d.ts.map +0 -1
  124. package/dist/pres-BcBR3CSM.d.ts +0 -202
  125. package/dist/pres-BcBR3CSM.d.ts.map +0 -1
  126. package/dist/presentation-DrJtj3-C.js.map +0 -1
  127. package/dist/presentation-types-CDjScsev.d.ts.map +0 -1
  128. package/dist/shapes-BemroU-z.js.map +0 -1
  129. package/dist/slide-ZqAdVvHV.d.ts.map +0 -1
  130. package/dist/text-B8SLEaZx.js +0 -11327
  131. package/dist/text-B8SLEaZx.js.map +0 -1
  132. package/dist/units-1kRzYShk.js +0 -231
  133. package/dist/units-1kRzYShk.js.map +0 -1
  134. package/dist/units-internal-Dg95w_YD.js.map +0 -1
  135. package/dist/zip.d.ts.map +0 -1
  136. package/dist/zip.js.map +0 -1
package/README.md CHANGED
@@ -1,87 +1,37 @@
1
1
  # ts-pptx
2
2
 
3
- > **`pptx-ts` is an alias.** It is the same package as
4
- > [`@shbernal/ts-pptx`](https://www.npmjs.com/package/@shbernal/ts-pptx), published from the
5
- > same commit at the same version with the same contents. Install one or the other,
6
- > never both: two copies of this library in one dependency tree are two module
7
- > registries, and state such as the diagnostic handler is per-copy. The scoped name is
8
- > canonical, and the issue tracker, the changelog and every example below use it.
9
-
10
- [![npm](https://img.shields.io/npm/v/%40shbernal%2Fts-pptx)](https://www.npmjs.com/package/@shbernal/ts-pptx)
11
- [![weekly downloads](https://img.shields.io/npm/dw/%40shbernal%2Fts-pptx.svg?label=npm%20downloads&logo=npm)](https://www.npmjs.com/package/@shbernal/ts-pptx)
12
- [![total downloads](https://img.shields.io/npm/dt/%40shbernal%2Fts-pptx.svg?label=npm%20total%20downloads&logo=npm)](https://www.npmjs.com/package/@shbernal/ts-pptx)
3
+ [![npm](https://img.shields.io/npm/v/pptx-ts)](https://www.npmjs.com/package/pptx-ts)
4
+ [![weekly downloads](https://img.shields.io/npm/dw/pptx-ts.svg?label=npm%20downloads&logo=npm)](https://www.npmjs.com/package/pptx-ts)
5
+ [![total downloads](https://img.shields.io/npm/dt/pptx-ts.svg?label=npm%20total%20downloads&logo=npm)](https://www.npmjs.com/package/pptx-ts)
13
6
  [![CI](https://github.com/shbernal/ts-pptx/actions/workflows/ci.yml/badge.svg)](https://github.com/shbernal/ts-pptx/actions/workflows/ci.yml)
14
7
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
15
8
 
16
- ts-pptx generates PowerPoint `.pptx` files from TypeScript and modern
17
- JavaScript. This project targets ESM package consumers, typed application code,
18
- reproducible package verification, and agent-assisted OOXML development.
9
+ **Write a program, get a PowerPoint file.**
19
10
 
20
- > **Lineage.** ts-pptx descends from [gitbrent/PptxGenJS](https://github.com/gitbrent/PptxGenJS)
21
- > (MIT), detached at its v6.0.0 (June 2025) and developed independently since. It
22
- > does not track, merge from, or mirror the original project, and pursues its own
23
- > Node-first direction (see _Project Target_). The original work remains under its
24
- > MIT license: see _License_ below.
11
+ A `.pptx` is a zip full of XML. ts-pptx writes that zip for you, so you describe
12
+ slides in TypeScript and a `.pptx` comes out the other end. PowerPoint never runs, no
13
+ Office licence is involved, and nothing has to be installed on the machine doing the
14
+ writing. The file opens cleanly in desktop PowerPoint, and Keynote, LibreOffice Impress
15
+ and Google Slides import it on a best-effort basis.
25
16
 
26
- ## Project Target
27
-
28
- - Generate standards-based PowerPoint `.pptx` packages without requiring
29
- PowerPoint at runtime.
30
- - Support TypeScript-first workflows with checked declarations and modern
31
- bundler resolution.
32
- - Ship a small, explicit ESM package boundary for Node.js, Vite, React,
33
- Angular, Electron, and similar modern toolchains.
34
- - Keep OOXML changes grounded in fixtures, schema validation, and PowerPoint
35
- compatibility evidence.
36
- - Make the repository practical for human and agent-driven maintenance.
17
+ Reach for it when a deck has to be built from data that changes: a monthly report,
18
+ one deck per customer, a hundred decks per night, or a download button on a page that
19
+ hands the user a deck built from what they are looking at.
37
20
 
38
21
  ## Install
39
22
 
40
23
  ```bash
41
- pnpm add @shbernal/ts-pptx
42
- ```
43
-
44
- ```bash
45
- npm install @shbernal/ts-pptx
46
- ```
47
-
48
- ```bash
49
- yarn add @shbernal/ts-pptx
50
- ```
51
-
52
- The unscoped name [`pptx-ts`](https://www.npmjs.com/package/pptx-ts) is an alias
53
- for the same package: same contents, same version, published from the same
54
- commit by the same workflow. Take it if a scoped name is awkward somewhere in
55
- your toolchain. Install one or the other and never both, because two copies of
56
- this library in one dependency tree are two module registries and state such as
57
- the diagnostic handler is per-copy. The scoped name is canonical: the issue
58
- tracker, the changelog and every example in these docs use it.
59
-
60
- ### Installing an unreleased commit
61
-
62
- Any commit is installable directly from GitHub, without waiting for a release:
63
-
64
- ```bash
65
- npm install github:shbernal/ts-pptx#<commit-sha>
24
+ pnpm add pptx-ts
66
25
  ```
67
26
 
68
- `master` (`github:shbernal/ts-pptx`) works too, but pin the sha: a branch spec
69
- re-resolves to whatever is at the head of it when the lockfile is next written.
70
-
71
- `dist/` is not committed, so this builds the package on install: your package
72
- manager clones the repo, installs this package's `devDependencies`, and runs its
73
- `prepare` script. That makes the install slow (a couple of minutes) and heavier
74
- than a registry install, and it needs a working Node toolchain. It is meant for
75
- trying a fix before it ships, not for production dependencies.
76
-
77
- Note that `pres.version` reports the version in `package.json` at that commit, so
78
- several different commits report the same number. The sha in your `package.json`
79
- is what identifies the build.
27
+ `@shbernal/ts-pptx` is the same package under its first name, so install one or the other.
28
+ [Installation](docs/getting-started/installation.md) covers npm, CommonJS and the optional
29
+ math dependencies.
80
30
 
81
- ## Quick Start
31
+ ## Quick start
82
32
 
83
33
  ```ts
84
- import TsPptx from "@shbernal/ts-pptx"
34
+ import TsPptx from "pptx-ts"
85
35
 
86
36
  const pptx = new TsPptx()
87
37
  const slide = pptx.addSlide()
@@ -98,218 +48,115 @@ slide.addText("Hello from ts-pptx", {
98
48
  await pptx.writeFile({ fileName: "example.pptx" })
99
49
  ```
100
50
 
101
- ## What It Can Generate
102
-
103
- - Slides, layouts, masters, sections, notes, and metadata.
104
- - Text, tables, shapes, images, SVGs, charts, and media.
105
- - Browser-downloadable, streamed, buffered, Blob, base64, or file outputs,
106
- depending on the runtime.
107
- - OOXML that is intended to open cleanly in Microsoft PowerPoint and other
108
- `.pptx` consumers such as Keynote, LibreOffice Impress, and Google Slides
109
- import.
110
-
111
- ## Scope And Contributions
112
-
113
- This project is **Node-first**: it generates and is tested without a browser or any
114
- office application. Two areas are out of *active* maintenance scope, not because
115
- they lack merit, but because there is no in-house use case driving them, so the
116
- maintainer generally will not pick up bugs or feature requests there:
117
-
118
- - **Live-DOM / browser-layout features**, anything whose answer comes from a
119
- *rendered* page: real `offsetWidth` after layout, the resolved cascade, fonts as
120
- the browser actually chose them. (Converting an HTML `<table>` is *not* in this
121
- category: see [HTML tables → slides](#html-tables--slides) below. Only real
122
- measurement needs a browser.)
123
- - **Third-party office-suite interop quirks** that appear only after a file is
124
- round-tripped through another application (for example, copy/paste inside WPS
125
- Office, then opening in PowerPoint) when the generated package is itself valid
126
- OOXML. The supported bar is that output opens cleanly in Microsoft PowerPoint.
127
-
128
- **Contributions in these areas are welcome**: issues and pull requests are
129
- encouraged even though the maintainer is not actively developing them. See
130
- [`docs/project-target.md`](docs/project-target.md) for the full scope statement
131
- and suggested testing approaches.
132
-
133
- ## Hit A Bug? There Is A Skill For That
134
-
135
- Most code that uses this library is written by an agent, and an agent that hits a
136
- library defect will usually route around it silently, so the defect is never
137
- reported and never fixed. `ts-pptx-upstream` is a skill that turns that moment into
138
- a filed issue with a minimal reproduction, which is what becomes a permanent
139
- regression test here. It ships inside the package, so it is already on disk:
140
-
141
- ```bash
142
- # Name the skill and the runtimes, and take the defaults: this is the form that
143
- # completes unattended, which is how an agent will be running it.
144
- npx skills add ./node_modules/@shbernal/ts-pptx -s '*' -a claude-code -a codex -a universal -y
145
-
146
- npx skills add shbernal/ts-pptx # same flags, straight from the repo instead of node_modules
147
- ```
148
-
149
- Drop the flags for an interactive prompt if you are at a terminal yourself. Do not reach
150
- for `--all` to avoid the prompt: it installs into every runtime the CLI knows about,
151
- around seventy of them, and leaves an `agent/` directory at your repository root for
152
- runtimes nobody there uses. Name the ones you have.
153
-
154
- Two things about living with the installed copy. It is a copy, so **a version bump does
155
- not update it**: re-run the command above, or `npx skills update ts-pptx-upstream`, in
156
- the same commit as the bump. And if you track it, track `skills-lock.json` and ignore the
157
- copy: `skills experimental_install` restores the file from that lock but creates none of
158
- the runtime links, so it is a record, not a restore command.
159
-
160
- It covers triage (is this ours, your deck's, or out of scope?), reducing a failure to
161
- a script that builds its own deck, and (because presentations carry client names and
162
- unreleased numbers) never uploading one to a public tracker. Once the reproduction
163
- stands on its own it files without interrupting you, and tells you the issue number
164
- afterwards. It also covers the far end of the cycle, which is the half that usually
165
- rots: when a release lands, finding every workaround it retires and deleting them.
166
-
167
- You do not need it to report something: <https://github.com/shbernal/ts-pptx/issues>
168
- is open, and errors the library knows are its own fault print that link themselves.
169
- See [errors](docs/errors.md#which-failures-are-worth-reporting) for which failures are
170
- worth a report.
171
-
172
- ## Runtime And Package Support
173
-
174
- The package is ESM-only.
175
-
176
- Supported package surface:
177
-
178
- - `import TsPptx, { ShapeType } from "@shbernal/ts-pptx"` (enums, shared types, and
179
- layout helpers ship from the main entry)
180
- - `import { inspectPptx } from "@shbernal/ts-pptx/inspect"`
181
- - `import { measureText } from "@shbernal/ts-pptx/measure"`
182
- - `import { Presentation } from "@shbernal/ts-pptx/read"`
183
- - `import { latexToOmml } from "@shbernal/ts-pptx/math"`
184
- - `import { tableToSlides } from "@shbernal/ts-pptx/html"`
185
- - `import TsPptx from "@shbernal/ts-pptx/node"`
186
- - `import TsPptx from "@shbernal/ts-pptx/browser"`:
187
- the bare specifier resolves to one of these two by export condition, so Node
188
- and bundled browser apps get the right build without naming it. A runtime that
189
- sets neither (Deno, Bun, edge workers) gets a runtime-agnostic build that
190
- authors and exports bytes normally but has no `writeFile` destination; see
191
- [Runtime And Package Support](docs/runtime-and-package-support.md#which-build-the-bare-import-gives-you).
192
- - generated runtime and declaration artifacts under `dist/`
193
- - Node.js `>=24`
194
- - modern bundlers and module-aware app frameworks
195
-
196
- Deliberately not supported:
197
-
198
- - No CommonJS: no `require("@shbernal/ts-pptx")`, no CJS export condition, and no
199
- `.cjs` artifact. Modern Node.js may provide `require()` interop for ESM, but it
200
- is not a maintained API.
201
- - No IIFE/global browser bundle: no classic-script global, no `dist/*.bundle.js`,
202
- and no `dist/*.min.js`.
203
-
204
- Use the package exports rather than direct `dist/` artifact paths.
205
-
206
- See [runtime and package support](docs/runtime-and-package-support.md) for the
207
- complete support contract.
208
-
209
- ## HTML Tables → Slides
210
-
211
- `@shbernal/ts-pptx/html` reproduces an existing HTML `<table>` as a PowerPoint
212
- table, auto-paging across as many slides as its rows need. It works in the
213
- browser and under Node with any DOM implementation, from one artifact.
214
-
215
- ```ts
216
- import { TsPptx } from '@shbernal/ts-pptx'
217
- import { tableToSlides } from '@shbernal/ts-pptx/html'
218
- import { Window } from 'happy-dom'
219
-
220
- const win = new Window()
221
- win.document.body.innerHTML = '<table id="report">…</table>'
222
-
223
- const pptx = new TsPptx()
224
- tableToSlides(pptx, win.document.getElementById('report'))
225
- await pptx.writeFile({ fileName: 'report.pptx' })
226
- ```
227
-
228
- Pass the element itself and no global DOM is consulted at all. To pass a string
229
- id instead, say which document it belongs to:
230
-
231
- ```ts
232
- tableToSlides(pptx, 'report', { document: win.document })
233
- ```
234
-
235
- In a browser, `options.document` defaults to the global `document`, so
236
- `tableToSlides(pptx, 'report')` is enough. The equivalent method form,
237
- `pptx.tableToSlides('report', options)`, remains on the browser build and
238
- delegates to the same implementation.
239
-
240
- **Column widths need a layout engine.** In a browser the columns are sized from
241
- each cell's rendered `offsetWidth`, reproducing the table's real proportions.
242
- Nothing outside a browser lays a table out, so `offsetWidth` is `0` there and
243
- the conversion falls back in two steps: it uses the computed CSS `width`s when the
244
- stylesheet states them for every column in one unit (all `px` or all `%`), and
245
- an equal split when it does not.
246
-
247
- The first step is a *fallback*, not a graceful loss of precision: `offsetWidth` is
248
- the border box and computed `width` the content box, so padding alone can put the
249
- two bases in different proportions. The same table can therefore come out with
250
- different column widths in a browser and outside one.
251
-
252
- To pin widths regardless of runtime, annotate the `<thead>` header cells, which
253
- win outright on every path:
254
-
255
- ```html
256
- <thead>
257
- <tr>
258
- <th data-pptx-width="2.5">Name</th>
259
- <th data-pptx-min-width="1">Qty</th>
260
- </tr>
261
- </thead>
262
- ```
263
-
264
- Everything else behaves the same wherever it runs: cell text (with `<br>` kept
265
- as a line break), `colspan`/`rowspan`, computed colors, weight, alignment,
266
- padding and borders, and auto-paging.
51
+ That is the whole shape of it. Make a presentation, add a slide, put things on the
52
+ slide, write the file. Positions are in inches by default, so `x: 1, y: 1` is an inch
53
+ in from the top-left corner of a 10 by 5.625 inch slide.
54
+ [Your first deck](docs/getting-started/first-deck.md) builds a bigger one from data, with a
55
+ table, a chart and speaker notes.
56
+
57
+ ## What you can put on a slide
58
+
59
+ Text and rich paragraphs. Tables, including ones that spill onto as many slides as
60
+ they need. Shapes and connectors between them. Pictures, SVGs, video and audio.
61
+ Charts, with a real embedded workbook behind them, so double-clicking a chart in
62
+ PowerPoint opens its data the way it does for a chart a human made. Speaker notes,
63
+ sections, slide masters and layouts, gradients, an image clipped to a shape, a
64
+ spreadsheet embedded as an object, a 3D model, and LaTeX maths.
65
+
66
+ Two features worth knowing about by name:
67
+
68
+ - **[An HTML table becomes slides](docs/html-tables.md).** Point `tableToSlides` at a
69
+ `<table>` you already have and it comes out as a PowerPoint table, paged across
70
+ slides. Works in a browser and under Node.
71
+ - **[Text that has to fit](docs/text-fit.md).** ts-pptx can measure the text
72
+ against the real font and shrink or grow the box before it writes the file, instead
73
+ of leaving you to guess at font sizes.
74
+
75
+ ## Reading decks, not only writing them
76
+
77
+ Writing is half of it. ts-pptx also opens a `.pptx` you already have, which is
78
+ unusual: the library it descends from generates decks and does not read them.
79
+
80
+ - **[Look inside one](docs/reference/pptx-inspection.md)** and get slide count, size,
81
+ parts, media and fonts, without loading the whole thing into a model.
82
+ - **[Edit one](docs/reading/read-and-edit.md)**. Open a deck, change the text on slide
83
+ four, save it back. Parts you did not touch come out byte for byte as they went in.
84
+ - **[Turn one into code](docs/reference/pptx-to-script.md)**. Point it at a deck and
85
+ get TypeScript that rebuilds it. Anything it could not express is reported to you
86
+ rather than dropped in silence. It is the fastest way to learn the API: build a
87
+ slide by hand in PowerPoint, then read the script for it.
88
+
89
+ ## Where it runs
90
+
91
+ | Runtime | Load it with | `writeFile` |
92
+ | --- | --- | --- |
93
+ | Node.js 24 or later | `import`, or `require()` with the class on `.default` | writes to disk |
94
+ | A browser app built with a bundler | `import` | downloads the file |
95
+ | A browser page with no build step | `import TsPptx from "https://esm.sh/pptx-ts/browser"` in a module script | downloads the file |
96
+ | Deno, Bun, edge workers | `import` | throws; use `toBytes()` |
97
+
98
+ [Where it runs](docs/getting-started/runtime.md) lists every entry point and how each runtime
99
+ loads the one ESM build.
100
+
101
+ <!-- comparison:start -->
102
+ <!-- GENERATED REGION. Do not edit by hand.
103
+ Regenerate with `pnpm run comparison:render`.
104
+ Source: `scripts/comparison/snapshot.json`, written by `scripts/comparison/measure.mjs`. -->
105
+
106
+ ## How this compares with PptxGenJS
107
+
108
+ ts-pptx is an independent derivative of
109
+ [PptxGenJS](https://github.com/gitbrent/PptxGenJS), detached at its v4.0.1. Both were
110
+ measured on 2026-09-21 by building the same 22 deck intents with each library and reading
111
+ the bytes that came out.
112
+
113
+ - **Construct coverage:** ts-pptx emitted 21 of 22, pptxgenjs 10 of 22. Nothing in the
114
+ corpus is emitted by pptxgenjs and not by ts-pptx.
115
+ - **Schema validity:** of the decks each library built, 21 of 21 ts-pptx decks and 0 of 10
116
+ pptxgenjs decks validate with no error against the Open XML SDK.
117
+ - **Adoption:** pptxgenjs is downloaded 10,539,687 times a month, against 1,780 for
118
+ ts-pptx. If a large installed base matters to you more than the differences above, use
119
+ pptxgenjs.
120
+ - **Activity:** last commit on the default branch, 2026-09-15 for ts-pptx and 2025-06-26
121
+ for pptxgenjs. Last npm publish, 2026-08-29 and 2025-06-26.
122
+
123
+ Where the two libraries part company is on the [comparison page](docs/comparison.md), and
124
+ [how it was measured](docs/comparison-method.md) has every full table. Every intent as
125
+ each library expresses it, including the calls that differ, is on [porting from
126
+ PptxGenJS](docs/comparison-syntax.md).
127
+
128
+ <!-- comparison:end -->
267
129
 
268
130
  ## Documentation
269
131
 
270
- The full documentation site is published at
271
- **<https://shbernal.github.io/ts-pptx/>**, including the generated API reference.
272
-
273
- - [Documentation index](docs/README.md)
274
- - [Project target](docs/project-target.md)
275
- - [Runtime and package support](docs/runtime-and-package-support.md)
276
- - [Development guide](docs/development.md)
277
- - [Testing guide](docs/testing.md)
278
- - [Agent development guide](docs/agent-development.md)
279
- - [OOXML agent context](docs/ooxml-agent-context.md)
280
- - [Evidence and fixtures](docs/evidence-and-fixtures.md)
281
-
282
- ## Repository Development
132
+ The documentation site, with the generated API reference, is at
133
+ **<https://shbernal.github.io/ts-pptx/>**. The [demos page](https://shbernal.github.io/ts-pptx/demos)
134
+ builds a quarterly review deck in your browser and previews the slides.
283
135
 
284
- This repository uses `pnpm` and requires Node.js `>=24`.
136
+ - Start with the [Introduction](docs/getting-started/introduction.md),
137
+ [Your first deck](docs/getting-started/first-deck.md) and
138
+ [Core concepts](docs/getting-started/concepts.md)
139
+ - [Tables](docs/tables.md), [connectors](docs/connectors.md), [groups](docs/groups.md) and
140
+ [HTML tables to slides](docs/html-tables.md)
141
+ - [Smaller bundles](docs/bundle-size.md) for a browser program that composes only what it uses
142
+ - [Errors and warnings](docs/errors-and-warnings.md) and
143
+ [troubleshooting](docs/troubleshooting.md)
285
144
 
286
- ```bash
287
- pnpm install
288
- pnpm run verify
289
- ```
145
+ ## Something wrong, or missing?
290
146
 
291
- OOXML serialization changes should also add or update a schema fixture in
292
- `test/schema-cases.js`. The schema suite validates through `ooxml-validate`, which
293
- fetches and caches its oracle binary on first use, so there is nothing to install.
147
+ Open an issue: <https://github.com/shbernal/ts-pptx/issues>. Errors the library knows
148
+ are its own fault print that link themselves.
294
149
 
295
- Package-boundary changes should run:
150
+ If an agent writes most of your code, install the `ts-pptx-upstream` skill that ships inside
151
+ the package. It turns a library defect the agent hits into a filed issue with a small
152
+ reproduction, instead of a silent workaround:
296
153
 
297
154
  ```bash
298
- pnpm run check:package
155
+ npx skills add ./node_modules/pptx-ts -s '*' -a claude-code -a codex -a universal -y
299
156
  ```
300
157
 
301
- ## Demos
302
-
303
- - `demos/showcases` builds the two flagship decks from one command.
304
- - `demos/node` exercises Node.js ESM generation and stream output.
305
- - The [demos page](https://shbernal.github.io/ts-pptx/demos) builds the quarterly review in
306
- your browser and previews the slides: nothing to clone.
307
-
308
- ## Relationship To Upstream
309
-
310
- ts-pptx builds on the original work of Brent Ely and the gitbrent/PptxGenJS
311
- contributors. The modernized package target is intentionally narrower than the
312
- original in order to simplify the runtime contract and keep maintenance focused.
158
+ Name the runtimes you use. [CONTRIBUTING.md](CONTRIBUTING.md) covers what the skill does
159
+ with a report and how to refresh it after a version bump.
313
160
 
314
161
  ## License
315
162