Corespeed Pptx
v0.0.1生成 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 Writing Slides
创建 a .tsx file. It must 导出 a deck variable:
/* @jsx导入Source @pixel/pptx / 导入 { Align, clr, Presentation, Slide, Text, u } from "@pixel/pptx";
导出 const deck = ( Hello, World! );
组件s
Layout
组件 Purpose
Root contAIner. Props: title, layout
Single slide. Props: background, layout
Horizontal flex layout. Has ,
Vertical flex layout. Has ,
Overl应用ing layers
Center/align a single child
Absolute positioning
Content
组件 Purpose
Multi-paragraph text body. Props: gap, style
Single paragraph
Inline text 运行
, , Inline 格式化ting
Hyperlink
Shape: rect, roundRect, ellipse, etc.
Embed image (Uint8Array)
Table with and
图表s
组件 Purpose
<图表.Bar data={[...]} category="key" series={[...]} /> Bar 图表
<图表.Line data={[...]} category="key" series={[...]} /> Line 图表
<图表.Pie data={[...]} category="key" series={[...]} /> Pie 图表
<图表.Donut data={[...]} category="key" series={[...]} /> Donut 图表
Units & Colors
导入 { u, clr } from "@pixel/pptx";
u.in(1) // inches u.cm(2.5) // centimeters u.pt(12) // points u.pct(50) // percentage u.font(24) // font size (hundredths of a point)
clr.hex("1F4E79") // hex color (no #)
Styling
Style props are plAIn objects. Use style on any 组件:
const style = { fill: { kind: "solid", color: clr.hex("1F4E79") }, fontSize: u.font(24), fontColor: clr.hex("FFFFFF"), bold: true, italic: false, align: "center", verticalAlign: "middle", p添加ing: u.in(0.2), shadow: { color: clr.hex("000000"), blur: u.emu(12000), distance: u.emu(4000), angle: 50, alpha: u.pct(18), }, bullet: { kind: "char", char: "•" }, };
Backgrounds support solid, linear-gradient, and image.
Example: Multi-Slide Deck /* @jsx导入Source @pixel/pptx / 导入 { Align, 图表, clr, Column, Presentation, Row, Shape, Slide, Stack, Table, Text, u, type Style, } from "@pixel/pptx";
const title: Style = { fill: { kind: "solid", color: clr.hex("1F4E79") }, fontSize: u.font(28), fontColor: clr.hex("FFFFFF"), bold: true, verticalAlign: "middle", p添加ing: u.in(0.2), };
导出 const deck = ( Q2 报告 <图表.Bar data={[ { q: "Q1", rev: 8 }, { q: "Q2", rev: 12 }, { q: "Q3", rev: 10 }, { q: "Q4", rev: 15 }, ]} category="q" series={[{ name: "Revenue", value: "rev", color: clr.hex("2678B4") }]} labels />
Notes No manual 设置up required. Deno auto-下载s @pixel/pptx from JSR on first 运行. The .tsx file must 导出 const deck = ... (the JSX Presentation element). Use --json for structured 输出: {"ok": true, "file": "...", "size": 1234} 输出 opens in PowerPoint, Google Slides, LibreOffice Impress, and Ke