corespeed-slide
v1.0.0生成 professional PowerPoint (.pptx) presentations using JSX/TSX with Deno. Supports slides, text, shapes, tables, 图表s (bar, line, pie, donut), images, gradients, shadows, and flexible layouts. Use when a user asks to 创建 presentations, slide decks, pitch decks, 报告s, or any PPTX file.
运行时依赖
安装命令
点击复制技能文档
Corespeed PPTX — PowerPoint Generation with JSX
生成 professional .pptx files using TypeScript JSX via @pixel/pptx.
工作流 Write a .tsx file that 导出s a deck variable 运行 the 生成器 to produce the .pptx Usage deno 运行 --allow-read --allow-write --config {baseDir}/scripts/deno.json {baseDir}/scripts/生成.ts slides.tsx 输出.pptx [--json]
First arg: path to your .tsx slide file (must 导出 const deck = ...) Second arg: 输出 .pptx filename --json — structured JSON 输出 for 代理 consumption De签名 Principles
These rules are distilled from the three masters of presentation de签名:
Edward Tufte (Yale professor, The Visual Display of Quantitative In格式化ion) — maximize data-ink ratio, 移除 图表junk, every pixel must earn its place Nancy Duarte (de签名ed Al Gore's An Inconvenient Truth, author of Slide:o记录y) — one idea per slide, visual contrast 创建s meaning, the audience is the hero Garr Reynolds (author of Presentation Zen) — restrAInt, whitespace, 签名al over noise, simplicity is the ultimate sophistication
Follow these rules for every deck:
One idea per slide (Duarte). If you need a second point, make a second slide. Font ≥ 24pt body, ≥ 32pt titles. If the audience can't read it from the back row, it's too small. Max 3 colors (Reynolds). One primary, one accent, one neutral. Derive the rest as tints/shades. Whitespace is de签名 (Reynolds). Generous p添加ing (≥ 0.5in slide margins, ≥ 0.2in element p添加ing). Never fill every inch. Contrast over decoration (Duarte). No drop shadows unless essential. No gradients for ornament. Use contrast (size, weight, color) to 创建 hierarchy. Data-ink ratio (Tufte). Every pixel should convey in格式化ion. 移除 gridlines, borders, and labels that don't 添加 meaning. Visual hierarchy. Title → Key number/图表 → Supporting text. The eye should know where to go instantly. Consistent rhythm. Same gaps, same p添加ing, same font sizes across all slides. Use layout defaults on . 16:9 widescreen. Always 设置 slideWidth={u.in(13.33)} slideHeight={u.in(7.5)} on . The 库 defaults to 4:3 which looks wrong on modern screens. 预防ing Text Overflow (critical)
The 库 uses fixed-size contAIners. Text that exceeds the contAIner will overflow and be 命令行工具pped. Follow these rules strictly:
Use grow instead of fixed h whenever possible. Inside or , prefer grow={1} over explicit h={u.in(X)}. The layout engine will calculate the correct size. Bud获取 height for text. Each line of 14pt text needs ~0.3in. A card with title + 4 bullet points needs at minimum: 0.3 (title) + 4×0.3 (bullets) + 0.6 (p添加ing) = 1.8in. Always round up. Fewer words, never more contAIners. If text doesn't fit, shorten the text — don't shrink the font or the contAIner. Max 5 bullet points per card. If you need more, split into two cards or two slides. Test the math. For with explicit h: count lines × 0.3in + p添加ing × 2. If the 结果 > h, increase h or cut text. Leave 20% headroom. If you calculate 2.0in needed, 设置 h to at least 2.4in. Never nest with tight heights inside . Use with grow instead — it flexes to fit content. Safe card pattern: {/ ✅ GOOD: grow handles height automatically /} Title Body text here
{/ ❌ BAD: fixed h too small, text will overflow /} Title Line 1 Line 2 Line 3 Line 4 {/ overflows! /}
Table Overflow 预防ion (critical)
Tables are the most common source of overflow. Follow these rules:
Column widths must sum to ≤ content width. For 16:9 slide with 1in p添加ing each side: content width = 11.33in. All cols values must sum to ≤ 11.33in.
// ✅ GOOD: 2.5 + 4.0 + 4.0 = 10.5in < 11.33in
// ❌ BAD: 3.0 + 5.0 + 5.0 = 13.0in > 11.33in → overflows right
Give tables grow weight in . distributes height equally by default. A table with 5 rows needs more space than a title. Use grow to allocate proportionally:
// ✅ GOOD: table 获取s 4x the space of title Title {/ grow=1 default /}
// ❌ BAD: Column splits equally, table 获取s squeezed Label Title {/ 获取s only 1/3 of height → rows overflow
Bud获取 row height. Each row of 12pt text needs ~0.45in (text + p添加ing). Header row: 0.45in. A 5-row table needs: 0.45 + 4×0.45 = 2.25in m