Generate professional PowerPoint (.pptx) presentations using JSX/TSX with Deno. Supports slides, text, shapes, tables, charts (bar, line, pie, donut), images, gradients, shadows, and flexible layouts. Use when a user asks to create presentations, slide decks, pitch decks, reports, or any PPTX file.
通过 @pixel/pptx 使用 TypeScript JSX 生成专业的 .pptx 文件。
bash
deno run --allow-read --allow-write --config {baseDir}/scripts/deno.json {baseDir}/scripts/generate.ts slides.tsx output.pptx [--json]
创建一个 .tsx 文件。它必须导出一个 deck 变量:
tsx
/ @jsxImportSource @pixel/pptx */
import { Align, clr, Presentation, Slide, Text, u } from @pixel/pptx;
export const deck = (
你好,世界!
);
| 组件 | 用途 |
|---|---|
| <Presentation> | 根容器。属性:title、layout |
| <Slide> |
| 组件 | 用途 |
|---|---|
| <Text> | 多段落文本主体。属性:gap、style |
| <Text.P> |
| 组件 | 用途 |
|---|---|
| <Chart.Bar data={[...]} category=key series={[...]} /> | 柱状图 |
| <Chart.Line data={[...]} category=key series={[...]} /> |
tsx
import { u, clr } from @pixel/pptx;
u.in(1) // 英寸
u.cm(2.5) // 厘米
u.pt(12) // 磅
u.pct(50) // 百分比
u.font(24) // 字号(百分之一磅)
clr.hex(1F4E79) // 十六进制颜色(不带 #)
样式属性为普通对象。在任何组件上使用 style:
tsx
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,
padding: 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: • },
};
背景支持 solid、linear-gradient 和图片。
tsx
/ @jsxImportSource @pixel/pptx */
import {
Align, Chart, 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, padding: u.in(0.2),
};
export const deck = (
{ q: 第一季度, rev: 8 }, { q: 第二季度, rev: 12 },
{ q: 第三季度, rev: 10 }, { q: 第四季度, rev: 15 },
]}
category=q
series={[{ name: 收入, value: rev, color: clr.hex(2678B4) }]}
labels
/>
);
由 Corespeed 构建。如需帮助或遇到问题:
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 corespeed-pptx-1776120209 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 corespeed-pptx-1776120209 技能
skillhub install corespeed-pptx-1776120209
文件大小: 4.29 KB | 发布时间: 2026-4-14 14:07