-
Notifications
You must be signed in to change notification settings - Fork 267
Expand file tree
/
Copy pathbuild-pptx.mjs
More file actions
46 lines (39 loc) · 1.28 KB
/
Copy pathbuild-pptx.mjs
File metadata and controls
46 lines (39 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { createRequire } from 'module';
import path from 'path';
import { fileURLToPath } from 'url';
const require = createRequire(import.meta.url);
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const PptxGenJS = require('pptxgenjs');
const html2pptx = require(path.join(__dirname, '..', '..', '..', 'tools', 'ppt_team_agent', '.claude', 'skills', 'pptx-skill', 'scripts', 'html2pptx.js'));
async function main() {
const pres = new PptxGenJS();
pres.layout = 'LAYOUT_WIDE';
const slides = [
'slide-01.html',
'slide-02.html',
'slide-03.html',
'slide-04.html',
'slide-05.html',
'slide-06.html',
'slide-07.html',
'slide-08.html',
'slide-09.html',
];
for (const slideFile of slides) {
const filePath = path.join(__dirname, slideFile);
console.log(`Converting ${slideFile}...`);
try {
await html2pptx(filePath, pres);
console.log(` OK: ${slideFile}`);
} catch (err) {
console.error(` ERROR in ${slideFile}: ${err.message}`);
}
}
const outputPath = path.join(__dirname, '..', '2026-02-20T12-52-report-deck.pptx');
await pres.writeFile({ fileName: outputPath });
console.log(`\nPPTX written to: ${outputPath}`);
}
main().catch(err => {
console.error('Fatal error:', err);
process.exit(1);
});