@mdgate/ppt 0.6.8 → 0.6.10

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 (2) hide show
  1. package/README.md +149 -8
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -1,26 +1,167 @@
1
1
  # @mdgate/ppt
2
2
 
3
- Convert legacy binary PowerPoint presentations to Markdown. Outputs GitHub-Flavored Markdown. Works in Node, Edge, and
4
- browsers. No native addons.
3
+ **Convert legacy PowerPoint `.ppt` files to Markdown in TypeScript.**
5
4
 
6
- Handles: `.ppt`, `.pps`, `.pot` (binary PowerPoint)
5
+ [`@mdgate/ppt`](https://github.com/mdgate/converters/tree/main/packages/ppt) reads binary PowerPoint files (`.ppt`, `.pps`, `.pot`) directly in JavaScript and converts slides into GitHub-Flavored Markdown, without Python, native addons, WASM, or PowerPoint.
7
6
 
8
- ## Usage
7
+ Works in **Node.js, Cloudflare Workers, Edge runtimes, and browsers**.
8
+
9
+ ```bash
10
+ npm install @mdgate/ppt
11
+ ```
12
+
13
+ ```ts
14
+ import { toMarkdown } from '@mdgate/ppt';
15
+
16
+ const markdown = await toMarkdown(bytes);
17
+ ```
18
+
19
+ `bytes` is a `Uint8Array`, so the deck can come from a file upload, object storage, an HTTP request, a browser file picker, or anywhere else your application gets bytes.
20
+
21
+ ---
22
+
23
+ ## Why [`@mdgate/ppt`](https://github.com/mdgate/converters/tree/main/packages/ppt)
24
+
25
+ Binary PowerPoint is still common in older mail threads and shared drives.
26
+
27
+ [`@mdgate/ppt`](https://github.com/mdgate/converters/tree/main/packages/ppt) reads the OLE compound file in the same runtime as your application:
28
+
29
+ * **Pure TypeScript**
30
+ * **PPT → Markdown locally**
31
+ * **No Python runtime**
32
+ * **No native addons**
33
+ * **No WASM runtime**
34
+ * **Zero third-party runtime dependencies**
35
+ * **Works with raw `Uint8Array` input**
36
+ * **Detects binary PowerPoint from OLE streams, not only the filename**
37
+
38
+ ---
39
+
40
+ ## What it extracts
41
+
42
+ [`@mdgate/ppt`](https://github.com/mdgate/converters/tree/main/packages/ppt) parses the binary presentation stream and rebuilds a shared document model.
43
+
44
+ The converter handles PowerPoint 97-2003 concerns including:
45
+
46
+ * slide text in reading order
47
+ * titles and body copy
48
+ * lists
49
+ * speaker notes when present
50
+ * encrypted document detection
51
+
52
+ OOXML decks (`.pptx`) are a different format. Use [`@mdgate/pptx`](https://github.com/mdgate/converters/tree/main/packages/pptx) for those.
53
+
54
+ ---
55
+
56
+ ## Node.js
57
+
58
+ ```ts
59
+ import { readFile } from 'node:fs/promises';
60
+ import { toMarkdown } from '@mdgate/ppt';
61
+
62
+ const bytes = new Uint8Array(await readFile('deck.ppt'));
63
+ const markdown = await toMarkdown(bytes);
64
+
65
+ console.log(markdown);
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Browser
71
+
72
+ ```ts
73
+ import { toMarkdown } from '@mdgate/ppt';
74
+
75
+ const file = input.files![0];
76
+ const bytes = new Uint8Array(await file.arrayBuffer());
77
+
78
+ const markdown = await toMarkdown(bytes);
79
+ ```
80
+
81
+ ---
82
+
83
+ ## Cloudflare Workers and Edge runtimes
9
84
 
10
85
  ```ts
11
86
  import { toMarkdown } from '@mdgate/ppt';
12
87
 
88
+ export default {
89
+ async fetch(request: Request) {
90
+ const bytes = new Uint8Array(await request.arrayBuffer());
91
+ const markdown = await toMarkdown(bytes);
92
+
93
+ return new Response(markdown, {
94
+ headers: {
95
+ 'content-type': 'text/markdown; charset=utf-8',
96
+ },
97
+ });
98
+ },
99
+ };
100
+ ```
101
+
102
+ ---
103
+
104
+ ## Format detection
105
+
106
+ You do not need to trust the file extension.
107
+
108
+ [`@mdgate/ppt`](https://github.com/mdgate/converters/tree/main/packages/ppt) recognizes binary PowerPoint from OLE compound-file streams.
109
+
110
+ ```ts
13
111
  const markdown = await toMarkdown(bytes);
14
112
  ```
15
113
 
16
- Compose with other converters:
114
+ A path can still be supplied as a format hint when [`@mdgate/ppt`](https://github.com/mdgate/converters/tree/main/packages/ppt) is used through [`@mdgate/converters`](https://github.com/mdgate/converters/tree/main/packages/converters) or a reader composed with [`@mdgate/core`](https://github.com/mdgate/converters/tree/main/packages/core), but the path is never used to read a file from disk.
115
+
116
+ ---
117
+
118
+ ## Encrypted presentations
119
+
120
+ Encrypted or password-protected files are reported as encrypted rather than returning misleading partial output.
121
+
122
+ ---
123
+
124
+ ## Compose it with other file readers
125
+
126
+ [`@mdgate/ppt`](https://github.com/mdgate/converters/tree/main/packages/ppt) implements the converter interface from [`@mdgate/core`](https://github.com/mdgate/converters/tree/main/packages/core).
17
127
 
18
128
  ```ts
19
129
  import { create } from '@mdgate/core';
20
130
  import { ppt } from '@mdgate/ppt';
131
+ import { pptx } from '@mdgate/pptx';
132
+
133
+ const read = create([
134
+ ppt(),
135
+ pptx(),
136
+ ]);
137
+ ```
138
+
139
+ The application still uses one reading interface while each format remains independently installable.
140
+
141
+ ---
142
+
143
+ ## Need more than PowerPoint?
144
+
145
+ If your application needs to read many different file types, use the complete converter set:
21
146
 
22
- const convert = create([ppt()]);
147
+ ```bash
148
+ npm install @mdgate/converters
23
149
  ```
24
150
 
25
- Part of [mdgate converters](https://github.com/mdgate/converters); install
26
- `@mdgate/converters` for every format at once.
151
+ ```ts
152
+ import { toMarkdown } from '@mdgate/converters';
153
+
154
+ const markdown = await toMarkdown(bytes, {
155
+ path: filename,
156
+ });
157
+ ```
158
+
159
+ [`@mdgate/ppt`](https://github.com/mdgate/converters/tree/main/packages/ppt) is one of the single-format packages in the open-source [`mdgate/converters`](https://github.com/mdgate/converters) project.
160
+
161
+ For AI agents, the same converter architecture can be used to extend `read_file` from text files to real-world document formats.
162
+
163
+ ---
164
+
165
+ ## License
166
+
167
+ MIT
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@mdgate/ppt",
3
- "version": "0.6.8",
3
+ "version": "0.6.10",
4
4
  "description": "mdgate legacy PowerPoint converter (binary .ppt)",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
- "homepage": "https://demo.mdgate.dev",
7
+ "homepage": "https://convert.mdgate.dev",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/mdgate/converters.git",
@@ -28,11 +28,11 @@
28
28
  "prepublishOnly": "bun run build"
29
29
  },
30
30
  "dependencies": {
31
- "@mdgate/containers": "0.6.8",
32
- "@mdgate/core": "0.6.8",
33
- "@mdgate/document": "0.6.8",
34
- "@mdgate/office-common": "0.6.8",
35
- "@mdgate/utils": "0.6.8"
31
+ "@mdgate/containers": "0.6.10",
32
+ "@mdgate/core": "0.6.10",
33
+ "@mdgate/document": "0.6.10",
34
+ "@mdgate/office-common": "0.6.10",
35
+ "@mdgate/utils": "0.6.10"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"