dsh-ppt 0.3.0 → 0.4.0
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.
- package/CHANGELOG.md +7 -0
- package/README.en.md +2 -1
- package/README.md +2 -1
- package/lib/index.js +3 -1
- package/lib/types.d.ts +2 -0
- package/package.json +2 -2
- package/skills/dsh-ppt/SKILL.md +31 -73
- package/skills/dsh-ppt/references/copywriting.md +3 -12
- package/skills/dsh-ppt/references/syntax.md +44 -0
- package/skills/dsh-ppt/references/themes.md +4 -0
- package/skills/dsh-ppt/references/troubleshooting.md +13 -0
- package/skills/dsh-ppt/scripts/build-deck.mjs +5 -2
- package/skills/dsh-ppt/scripts/deck-core.mjs +71 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
- **动效(motion,默认开)**:HTML 放映页间淡入 + 要点按序逐条入场(打印自动兜底为静态);PPTX 每页原生淡入转场,`bullets` 页按段落构建、放映时点击一次出现一条要点(PowerPoint「出现,按段落」标准时序)。
|
|
6
|
+
- **`motion` 开关**:`ppt_create` 新增 `motion: 'on' | 'off'`,CLI 新增 `--motion on|off`;`off` 时产物不含任何动画代码,适合严肃/打印场景。manifest 记录该开关。
|
|
7
|
+
- **技能文件瘦身**:SKILL.md 收敛为触发条件 + 执行纪律 + 六步流水线 + 按需装载索引 + 质量门禁;新增 `references/syntax.md`(Markdown 解析、表格/金句/备注语法、结构化 slides、motion)与 `references/troubleshooting.md`;写作规则去重归口 `references/copywriting.md`,hyperframes 视觉联动并入 `references/themes.md`。
|
|
8
|
+
- 动效相关测试 8 例(转场/时序树/点击节点计数/静态开关/CLI/工具层),全套 42/42 通过。
|
|
9
|
+
|
|
3
10
|
## 0.3.0
|
|
4
11
|
|
|
5
12
|
- **演讲者备注**:结构化 `slides` 的 `notes` 字段与 Markdown `<!-- 备注: ... -->` 注释都会成为该页备注;HTML 放映按 `S` 键(或右下角「备注」按钮)呼出备注面板;PPTX 生成原生 `notesSlide` + `notesMaster` 部件,PowerPoint 演示者视图直接可用。
|
package/README.en.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://awesome-dsh-plugin.com)
|
|
6
6
|
|
|
7
|
-
> **One sentence or one document → a complete presentation**: HTML web slideshow + PPTX export, 5 visual themes, bilingual Chinese/English.
|
|
7
|
+
> **One sentence or one document → a complete presentation**: HTML web slideshow + PPTX export, 5 visual themes, slide transitions + bullet entrance animations, bilingual Chinese/English.
|
|
8
8
|
|
|
9
9
|
DeepSeek Harness (DSH) presentation skill + tool plugin: turns a sentence, a paragraph, or a Markdown document into a ready-to-present **HTML slideshow** and an editable **PPTX**. Pure Node, **zero runtime dependencies**, one codebase for Windows / macOS / Linux.
|
|
10
10
|
|
|
@@ -16,6 +16,7 @@ DeepSeek Harness (DSH) presentation skill + tool plugin: turns a sentence, a par
|
|
|
16
16
|
| `ppt_themes` tool | Lists the 5 built-in themes and their best use cases |
|
|
17
17
|
| 7 layouts | cover / section / bullets / statement / **quote** / **table** / closing |
|
|
18
18
|
| Speaker notes | `<!-- note: ... -->` comments or the `notes` field: press `S` in the HTML player; native PPTX notes slides (presenter view) |
|
|
19
|
+
| Motion | On by default: HTML slide-in transitions + staggered bullet entrances; native PPTX fade transitions + click-to-reveal bullets. `motion: 'off'` / `--motion off` for a fully static deck |
|
|
19
20
|
| Markdown extras | Tables (`\| ... \|`), blockquotes (`>`), and note comments are auto-detected into matching layouts |
|
|
20
21
|
| `dsh-ppt` skill | A complete six-step SOP registered into DSH |
|
|
21
22
|
| Standalone SKILL.md | Copy `skills/dsh-ppt/` into Claude Code / Cursor / Gemini CLI / Codex for cross-harness use |
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# dsh-ppt
|
|
4
4
|
|
|
5
|
-
> **一句话 / 一篇文档 → 完整演示文稿**:HTML 网页放映 + PPTX 导出,5
|
|
5
|
+
> **一句话 / 一篇文档 → 完整演示文稿**:HTML 网页放映 + PPTX 导出,5 套视觉主题,页间转场 + 要点入场动画,中英双语。
|
|
6
6
|
|
|
7
7
|
   
|
|
8
8
|
|
|
@@ -18,6 +18,7 @@ DSH(DeepSeek Harness)演示文稿技能 + 工具插件:把一句话、一
|
|
|
18
18
|
| `ppt_themes` 工具 | 列出 5 套内置主题与适用场景 |
|
|
19
19
|
| 7 种页型 | 封面 / 章节 / 要点 / 核心观点 / **金句** / **表格** / 结束页 |
|
|
20
20
|
| 演讲者备注 | `<!-- 备注: ... -->` 或 `notes` 字段:HTML 按 `S` 呼出,PPTX 原生备注页(演示者视图) |
|
|
21
|
+
| 动效(motion) | 默认开:HTML 页间淡入 + 要点逐条入场;PPTX 原生转场 + 要点逐条点击显现;`motion: 'off'` / `--motion off` 产出纯静态 |
|
|
21
22
|
| Markdown 进阶 | 表格(`\| ... \|`)、引用金句(`>`)、备注注释自动识别成对应页型 |
|
|
22
23
|
| `dsh-ppt` 技能 | 完整 SOP 注册进 DSH:从一句话到成品 deck 的六步流水线 |
|
|
23
24
|
| 裸 SKILL.md | 把 `skills/dsh-ppt/` 复制到 Claude Code / Cursor / Gemini CLI / Codex 即可跨 harness 使用 |
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* dsh-ppt —— 演示文稿技能 +
|
|
2
|
+
* dsh-ppt —— 演示文稿技能 + 工具插件。
|
|
3
3
|
*
|
|
4
4
|
* 一句话或一篇 Markdown 文档 → 完整演示文稿三件套:
|
|
5
5
|
* deck.html 独立网页放映(无外链)
|
|
@@ -160,6 +160,7 @@ export function apply(ctx, config = {}) {
|
|
|
160
160
|
content: { type: 'string', required: true, description: 'Markdown content: one sentence, a paragraph, or a full document. First # heading becomes the cover title; ## headings become slides; -/* lists become bullets; | ... | tables become table slides; > blockquotes become quote slides; <!-- 备注: ... --> comments become speaker notes. Required unless slides is provided.' },
|
|
161
161
|
theme: { type: 'string', description: 'Visual theme id: swiss / velvet / data / soft / bold. Default data. See ppt_themes.' },
|
|
162
162
|
lang: { type: 'string', description: 'UI language of the generated player: zh (default), en, or bilingual. Content language is whatever you write.' },
|
|
163
|
+
motion: { type: 'string', enum: ['on', 'off'], description: 'Slide transitions plus bullet entrance animations: on (default) or off for a fully static deck.' },
|
|
163
164
|
slides: { type: 'array', items: { type: 'object', additionalProperties: true }, description: 'Optional structured slides: [{ layout: cover|section|bullets|statement|quote|table|closing, title, subtitle, kicker, bullets: [], rows: [][] (for table), notes: "speaker notes" }]. Use this for precise control instead of content.' },
|
|
164
165
|
outputDir: { type: 'string', description: 'Directory to write the files into. Default: session working directory (or the plugin outputDir config).' },
|
|
165
166
|
fileName: { type: 'string', description: 'Base file name for the three artifacts. Default: sanitized deck title.' },
|
|
@@ -183,6 +184,7 @@ export function apply(ctx, config = {}) {
|
|
|
183
184
|
slides: hasSlides ? args.slides : undefined,
|
|
184
185
|
theme: typeof args.theme === 'string' && args.theme.trim() !== '' ? args.theme.trim() : (resolved.defaultTheme || undefined),
|
|
185
186
|
lang: typeof args.lang === 'string' && args.lang.trim() !== '' ? args.lang.trim() : (resolved.defaultLang || undefined),
|
|
187
|
+
motion: args.motion,
|
|
186
188
|
outputDir: typeof args.outputDir === 'string' && args.outputDir.trim() !== '' ? args.outputDir.trim() : (resolved.outputDir || undefined),
|
|
187
189
|
fileName: typeof args.fileName === 'string' && args.fileName.trim() !== '' ? args.fileName.trim() : undefined,
|
|
188
190
|
maxSlides: resolved.maxSlides,
|
package/lib/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ppt",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "DSH 演示文稿技能 + 工具插件:一句话或一篇 Markdown 文档 → 完整演示文稿(独立 HTML 网页放映 + 可编辑 PPTX 导出),内置 5
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "DSH 演示文稿技能 + 工具插件:一句话或一篇 Markdown 文档 → 完整演示文稿(独立 HTML 网页放映 + 可编辑 PPTX 导出),内置 5 套视觉主题与页间转场/要点入场动画(motion 可关),可配置默认主题/语言,中英双语,SKILL.md 薄路由 + references 按需装载,跨 harness。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
package/skills/dsh-ppt/SKILL.md
CHANGED
|
@@ -1,101 +1,59 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dsh-ppt
|
|
3
|
-
description: "Turn one sentence or a Markdown document into a complete, presentation-ready deck: a standalone HTML web slideshow plus an editable PPTX export, with 5 built-in visual themes (Swiss Pulse / Velvet Standard / Data Drift / Soft Signal / Maximalist Type) and bilingual Chinese/English support. Use when the user asks for a PPT, slides, deck, keynote, 演示文稿, 幻灯片, 汇报, 提案, 路演, 培训材料, or wants to turn a document into a presentation. 中文:把一句话或一篇文档变成完整演示文稿(HTML 网页放映 + PPTX 导出),内置 5
|
|
3
|
+
description: "Turn one sentence or a Markdown document into a complete, presentation-ready deck: a standalone HTML web slideshow plus an editable PPTX export, with 5 built-in visual themes (Swiss Pulse / Velvet Standard / Data Drift / Soft Signal / Maximalist Type), slide transitions + bullet entrance animations (motion, on by default), and bilingual Chinese/English support. Use when the user asks for a PPT, slides, deck, keynote, 演示文稿, 幻灯片, 汇报, 提案, 路演, 培训材料, or wants to turn a document into a presentation. 中文:把一句话或一篇文档变成完整演示文稿(HTML 网页放映 + PPTX 导出),内置 5 套视觉主题、页间转场与要点入场动画,中英双语。"
|
|
4
4
|
compatibility: "DSH plugin runs in-process with zero runtime dependencies. The standalone CLI needs Node.js >= 20. Cross-harness: copy this skill directory into any Agent Skills directory."
|
|
5
5
|
allowed-tools: "Bash, Read, Write, Edit"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# dsh-ppt
|
|
9
9
|
|
|
10
|
-
一句话或一篇文档 → 完整演示文稿:**独立 HTML 网页放映 + 可编辑 PPTX
|
|
10
|
+
一句话或一篇文档 → 完整演示文稿:**独立 HTML 网页放映 + 可编辑 PPTX**。本文件只做路由与纪律;具体规则按需读取 `references/`。
|
|
11
11
|
|
|
12
12
|
## 触发条件
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
- 用户给了一句话、一段文字或一篇 Markdown 文档,希望变成可放映/可分享的演示。
|
|
16
|
-
- 用户提到导出 PPTX 或网页版幻灯片。
|
|
14
|
+
用户要做 PPT / 幻灯片 / 演示文稿 / deck / 汇报 / 提案 / 路演 / 培训材料,或给一句话、一段文字、一篇 Markdown 想变成可放映的演示。
|
|
17
15
|
|
|
18
|
-
##
|
|
16
|
+
## 执行纪律(每次都要遵守)
|
|
19
17
|
|
|
20
|
-
1. **Probe 需求**:读入用户的句子/文档。确定听众、目标(说服/汇报/教学/发布)、语气与情绪基调。一句话输入不要反问,直接按发布场景推断并产出完整内容。
|
|
21
|
-
2. **Outline 大纲**:产出 5–12 页大纲。每页只讲一个观点;页型组合固定为:封面 → 问题/背景 → 方案/论点(3–6 页)→ 证据/案例 → 行动号召 → 结束页。每页要点不超过 6 条,每条不超过 20 字(中文)或 12 词(英文)。
|
|
22
|
-
3. **Theme 主题**:调用 `ppt_themes`(DSH)或 `node scripts/build-deck.mjs --list-themes`(跨 harness)选择视觉主题。情绪 → 主题映射见 `references/themes.md`;默认 `data`(技术/AI),高管汇报用 `velvet`,数据报表用 `swiss`,温暖叙事用 `soft`,大声量发布用 `bold`。
|
|
23
|
-
4. **Build 生成**:
|
|
24
|
-
- DSH 内:调用 `ppt_create`,把大纲写成 Markdown 传 `content`(推荐),或直接传结构化 `slides`。
|
|
25
|
-
- 跨 harness:`node <skill-dir>/scripts/build-deck.mjs --title "标题" --content deck.md --theme data --lang zh --out dist`
|
|
26
|
-
- 输出三件套:`*.html`(双击即放映)、`*.pptx`(可编辑)、`*.json`(manifest)。
|
|
27
|
-
5. **Verify 校验**:确认 HTML 页数与大纲一致、标题/要点无截断;PPTX 文件头为 `PK`(zip)。DSH 内用文件工具读取确认;跨 harness 用 `unzip -l deck.pptx | grep presentation.xml` 或 PowerShell `Expand-Archive` 抽查。
|
|
28
|
-
6. **Deliver 交付**:给用户三个绝对路径,并说明:HTML 浏览器直接打开(方向键翻页、F 全屏、G 总览、S 演讲者备注、P 打印/另存 PDF);PPTX 用 PowerPoint / WPS / Keynote 打开(备注在演示者视图可见)。
|
|
29
|
-
|
|
30
|
-
## 内容写作规则
|
|
31
|
-
|
|
32
|
-
- 一句话输入也要「完整」:封面 = 标题 + 那句话;核心观点页 = 原句放大;结束页 = 谢谢/行动号召。若用户要求更丰富,先自行扩写成 6–10 页大纲再构建。
|
|
33
18
|
- 一页一个观点;标题是判断句,不是名词短语。
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
## Markdown 进阶语法(自动识别)
|
|
39
|
-
|
|
40
|
-
- **表格**:`| 列 | 列 |` 连续行(第二行 `| --- | --- |` 分隔线)→ 独立 `table` 页(主题色表头,限 9 行 8 列)。数据对比优先用表格,别堆要点。
|
|
41
|
-
- **金句**:`>` 引用块 → 独立 `quote` 页;最后一行写 `—— 出处` 会成为署名。
|
|
42
|
-
- **演讲者备注**:`<!-- 备注: 这页要讲的内容 -->`(或 `<!-- note: ... -->`)附着到该页。备注不进正文:HTML 放映按 `S` 呼出备注面板,PPTX 写入原生备注(演示者视图可见)。为汇报/演讲类 deck 主动写备注(口径、数据出处、应答预案)。
|
|
43
|
-
|
|
44
|
-
## 主题选择
|
|
45
|
-
|
|
46
|
-
内置 5 套主题(源自 hyperframes 视觉风格库):
|
|
47
|
-
|
|
48
|
-
| 主题 ID | 名称 | 情绪 | 适用 |
|
|
49
|
-
| --- | --- | --- | --- |
|
|
50
|
-
| `data` | 数据漂移 | 未来/沉浸 | AI、技术发布、研究(默认) |
|
|
51
|
-
| `swiss` | 瑞士脉冲 | 精准/理性 | 数据、SaaS、开发者工具 |
|
|
52
|
-
| `velvet` | 天鹅绒标准 | 高级/克制 | 高管汇报、品牌、融资路演 |
|
|
53
|
-
| `soft` | 柔和信号 | 温暖/人本 | 品牌故事、培训、个人分享 |
|
|
54
|
-
| `bold` | 极繁大字 | 大声/动能 | 产品发布、活动、大事件 |
|
|
55
|
-
|
|
56
|
-
完整色板与反模式见 `references/themes.md`。
|
|
19
|
+
- 内容语言由你撰写;`lang` 只决定界面文字。
|
|
20
|
+
- 先选主题再构建;不确定就用默认 `data`。
|
|
21
|
+
- 交付前逐项过一遍文末「质量门禁」。
|
|
57
22
|
|
|
58
|
-
##
|
|
23
|
+
## 核心流水线
|
|
59
24
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
25
|
+
1. **Probe 需求**:读入用户的句子/文档,确定听众、目标、语气。一句话输入不要反问,直接按发布场景推断。
|
|
26
|
+
2. **Outline 大纲**:产出 5–12 页大纲(封面 → 问题/背景 → 方案/论点 3–6 页 → 证据 → 行动号召 → 结束页)。
|
|
27
|
+
→ 写大纲与正文前先读 `references/copywriting.md`。
|
|
28
|
+
3. **Theme 主题**:调 `ppt_themes`(DSH)或 `node scripts/build-deck.mjs --list-themes`(跨 harness)。
|
|
29
|
+
→ 拿不准选哪套时读 `references/themes.md` 的情绪决策树。
|
|
30
|
+
4. **Build 生成**:
|
|
31
|
+
- DSH 内:调 `ppt_create`,大纲写成 Markdown 传 `content`(推荐),或传结构化 `slides`。
|
|
32
|
+
- 跨 harness:`node <skill-dir>/scripts/build-deck.mjs --title "标题" --content deck.md --theme data --lang zh --out dist`。
|
|
33
|
+
- 动效默认开(页间转场 + 要点逐条入场);严肃/打印场景传 `motion: 'off'`。
|
|
34
|
+
→ 用表格 / 金句 / 备注 / 结构化 slides 前读 `references/syntax.md`。
|
|
35
|
+
5. **Verify 校验**:确认 HTML 页数与大纲一致、标题无截断、PPTX 文件头为 `PK`。
|
|
36
|
+
6. **Deliver 交付**:给用户三个绝对路径,说明 HTML 直接放映(← → 翻页 · F 全屏 · G 总览 · S 备注 · P 打印),PPTX 用 PowerPoint / WPS / Keynote 打开(备注在演示者视图可见,bullets 页放映时逐条点击出现)。
|
|
37
|
+
|
|
38
|
+
## 按需装载索引
|
|
39
|
+
|
|
40
|
+
| 何时读 | 文件 | 内容 |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| 写大纲 / 正文前 | `references/copywriting.md` | 叙事骨架、单页规则、双语规则 |
|
|
43
|
+
| 选主题拿不准 | `references/themes.md` | 5 套主题色板 + 情绪决策树 |
|
|
44
|
+
| 用表格/金句/备注/结构化 slides | `references/syntax.md` | Markdown 解析、进阶语法、slides JSON、motion 开关 |
|
|
45
|
+
| 交付异常 | `references/troubleshooting.md` | 症状 → 处理对照表 |
|
|
79
46
|
|
|
80
47
|
## 质量门禁(交付前逐项确认)
|
|
81
48
|
|
|
82
49
|
- [ ] 页数 3–60,首屏是封面,末屏是结束页。
|
|
83
|
-
- [ ] 每页有明确标题;bullets 页 1–8
|
|
50
|
+
- [ ] 每页有明确标题;bullets 页 1–8 条,中文每条 ≤ 20 字、英文 ≤ 12 词。
|
|
84
51
|
- [ ] HTML 与 PPTX 使用同一主题,配色一致。
|
|
85
52
|
- [ ] 主题色对比度足够(深底浅字或浅底深字)。
|
|
86
53
|
- [ ] 中文内容无错别字;英文标题用 Title Case。
|
|
54
|
+
- [ ] 最后一页有可执行的行动号召,不只是「谢谢」。
|
|
87
55
|
- [ ] 文件已写到用户工作区,路径为绝对路径。
|
|
88
56
|
|
|
89
|
-
## 故障排查
|
|
90
|
-
|
|
91
|
-
| 症状 | 处理 |
|
|
92
|
-
| --- | --- |
|
|
93
|
-
| `ppt_create` 不存在 | 本插件未安装;用 `node <skill-dir>/scripts/build-deck.mjs` 裸 CLI 生成同样三件套 |
|
|
94
|
-
| 未知主题 | `ppt_themes` 或 `--list-themes` 看可用 ID;不要猜 |
|
|
95
|
-
| 内容超过 60 页 | 合并论点,或拆成多个 deck;`maxSlides` 默认 60 |
|
|
96
|
-
| PPTX 打不开 | 确认文件完整(zip 头 `PK`);Office 首次打开空白版式属正常,编辑视图可用 |
|
|
97
|
-
| 双语界面 | `lang: bilingual` 只双语化界面;内容双语由 agent 在写作阶段完成 |
|
|
98
|
-
|
|
99
57
|
## 跨 harness 安装
|
|
100
58
|
|
|
101
59
|
把整个 `dsh-ppt` 技能目录复制到目标 agent 的技能目录即可(只依赖 Node 20+):
|
|
@@ -30,18 +30,9 @@
|
|
|
30
30
|
- 英文标题用 Title Case;术语首现给中文+英文,如「检索增强生成(RAG)」。
|
|
31
31
|
- 双语时不要逐句直译,按目标语言习惯重写。
|
|
32
32
|
|
|
33
|
-
## Markdown
|
|
34
|
-
|
|
35
|
-
`
|
|
36
|
-
|
|
37
|
-
- 第一个 `# 标题` 会成为封面标题;其后的段落/列表成为封面副标题来源。
|
|
38
|
-
- 每个 `## 小节`(或更深标题)生成一页:
|
|
39
|
-
- 有 `- ` / `* ` / `1.` 列表 → `bullets` 页;
|
|
40
|
-
- 无列表且无正文 → `section` 过渡页;
|
|
41
|
-
- 有正文段落 → 正文拆句后作为 bullets。
|
|
42
|
-
- 没有标题的纯文本:第一段第一句为封面副标题,后续段落按 5 句一组拆成要点页。
|
|
43
|
-
- 只有一句话:自动生成「封面 → 核心观点 → 结束页」三页。
|
|
44
|
-
- 需要更精细控制时使用结构化 `slides` JSON,不要和 Markdown 混用。
|
|
33
|
+
## Markdown 与结构化输入
|
|
34
|
+
|
|
35
|
+
解析规则、表格/金句/备注语法与结构化 `slides` JSON 见 `syntax.md`。
|
|
45
36
|
|
|
46
37
|
## 示例
|
|
47
38
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# dsh-ppt 输入语法参考(Markdown / 结构化 slides / 动效)
|
|
2
|
+
|
|
3
|
+
只在需要查具体语法时读本文件;常规流程在 SKILL.md。
|
|
4
|
+
|
|
5
|
+
## Markdown 解析规则
|
|
6
|
+
|
|
7
|
+
`ppt_create` 与 `build-deck.mjs` 按以下规则解析 Markdown:
|
|
8
|
+
|
|
9
|
+
- 第一个 `# 标题` 会成为封面标题;其后的段落/列表成为封面副标题来源。
|
|
10
|
+
- 每个 `## 小节`(或更深标题)生成一页:
|
|
11
|
+
- 有 `- ` / `* ` / `1.` 列表 → `bullets` 页;
|
|
12
|
+
- 无列表且无正文 → `section` 过渡页;
|
|
13
|
+
- 有正文段落 → 正文拆句后作为 bullets。
|
|
14
|
+
- 没有标题的纯文本:第一段第一句为封面副标题,后续段落按 5 句一组拆成要点页。
|
|
15
|
+
- 只有一句话:自动生成「封面 → 核心观点 → 结束页」三页。
|
|
16
|
+
- 需要更精细控制时使用结构化 `slides` JSON,不要和 Markdown 混用。
|
|
17
|
+
|
|
18
|
+
## 进阶语法(自动识别)
|
|
19
|
+
|
|
20
|
+
- **表格**:`| 列 | 列 |` 连续行(第二行 `| --- | --- |` 分隔线)→ 独立 `table` 页(主题色表头,限 9 行 8 列)。数据对比优先用表格,别堆要点。
|
|
21
|
+
- **金句**:`>` 引用块 → 独立 `quote` 页;最后一行写 `—— 出处` 会成为署名。
|
|
22
|
+
- **演讲者备注**:`<!-- 备注: 这页要讲的内容 -->`(或 `<!-- note: ... -->`)附着到该页。备注不进正文:HTML 放映按 `S` 呼出备注面板,PPTX 写入原生备注(演示者视图可见)。为汇报/演讲类 deck 主动写备注(口径、数据出处、应答预案)。
|
|
23
|
+
|
|
24
|
+
## 结构化 slides(高级用法)
|
|
25
|
+
|
|
26
|
+
`ppt_create` 的 `slides` 与 CLI `--slides` 接受 JSON 数组:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
[
|
|
30
|
+
{ "layout": "cover", "title": "标题", "subtitle": "副标题", "kicker": "开场", "notes": "开场先自我介绍 30 秒" },
|
|
31
|
+
{ "layout": "section", "kicker": "01", "title": "背景" },
|
|
32
|
+
{ "layout": "bullets", "title": "三个论点", "bullets": ["论点一", "论点二", "论点三"] },
|
|
33
|
+
{ "layout": "table", "title": "业绩对比", "rows": [["大区", "营收"], ["华东", "1.2 亿"]], "notes": "强调华东增速" },
|
|
34
|
+
{ "layout": "quote", "title": "慢就是快。", "subtitle": "创始人" },
|
|
35
|
+
{ "layout": "statement", "title": "核心观点一句话", "subtitle": "支撑说明" },
|
|
36
|
+
{ "layout": "closing", "title": "谢谢", "subtitle": "行动号召" }
|
|
37
|
+
]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`layout` 仅限 `cover | section | bullets | statement | quote | table | closing`;每页可选 `notes`(演讲者备注),`table` 页用 `rows`(首行为表头)。Markdown 输入不够精确时,用结构化 slides 重写。
|
|
41
|
+
|
|
42
|
+
## 动效(motion)
|
|
43
|
+
|
|
44
|
+
默认 `motion: on`:HTML 放映有页间淡入与要点逐条入场;PPTX 每页原生淡入转场,`bullets` 页的要点按「点击一次出现一条」放映。交付严肃/打印场景或用户明确要静态时传 `motion: 'off'`(CLI `--motion off`),产物不含任何动画代码。
|
|
@@ -53,3 +53,7 @@
|
|
|
53
53
|
5. 情绪是大音量/发布会 → `bold`
|
|
54
54
|
|
|
55
55
|
无法判断时用 `data`,不要自造主题 ID。
|
|
56
|
+
|
|
57
|
+
## 视觉引擎复用(hyperframes)
|
|
58
|
+
|
|
59
|
+
如果 `hyperframes` 技能已安装,生成前先读它的 `visual-styles.md` / `house-style.md` 作为视觉判断依据;本技能的 5 套主题就是把其中 Swiss Pulse / Velvet Standard / Data Drift / Soft Signal / Maximalist Type 五套风格落成确定性 HTML+PPTX 实现。需要高级动画视频版时,才转用 hyperframes;普通演示不要上视频引擎。
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# dsh-ppt 故障排查
|
|
2
|
+
|
|
3
|
+
只在交付异常时读本文件。
|
|
4
|
+
|
|
5
|
+
| 症状 | 处理 |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `ppt_create` 不存在 | 本插件未安装;用 `node <skill-dir>/scripts/build-deck.mjs` 裸 CLI 生成同样三件套 |
|
|
8
|
+
| 未知主题 | `ppt_themes` 或 `--list-themes` 看可用 ID;不要猜 |
|
|
9
|
+
| 内容超过 60 页 | 合并论点,或拆成多个 deck;`maxSlides` 默认 60 |
|
|
10
|
+
| PPTX 打不开 | 确认文件完整(zip 头 `PK`);Office 首次打开空白版式属正常,编辑视图可用 |
|
|
11
|
+
| 双语界面 | `lang: bilingual` 只双语化界面;内容双语由 agent 在写作阶段完成 |
|
|
12
|
+
| 放映没有动画 | `motion` 被设为 `off`;默认 `on` 时 HTML 有转场、PPTX 要点逐条点击出现 |
|
|
13
|
+
| HTML 打印要点缺失 | 打印样式已强制显示全部要点;若仍缺失检查浏览器是否屏蔽了动画样式 |
|
|
@@ -16,7 +16,7 @@ import { resolve as resolvePath } from 'node:path'
|
|
|
16
16
|
import { pathToFileURL } from 'node:url'
|
|
17
17
|
import { buildDeck, listThemes, THEME_IDS, DEFAULT_THEME } from './deck-core.mjs'
|
|
18
18
|
|
|
19
|
-
const HELP = `dsh-ppt
|
|
19
|
+
const HELP = `dsh-ppt —— 一句话 / 一篇文档 → HTML 放映 + PPTX 导出
|
|
20
20
|
|
|
21
21
|
用法:
|
|
22
22
|
node build-deck.mjs --title <标题> --content <Markdown 或文件路径> [选项]
|
|
@@ -27,6 +27,7 @@ const HELP = `dsh-ppt v0.1.0 —— 一句话 / 一篇文档 → HTML 放映 + P
|
|
|
27
27
|
--slides <json> 结构化 slides JSON(可选,与 --content 二选一)
|
|
28
28
|
--theme <id> 视觉主题:${THEME_IDS.join(' / ')}(默认 ${DEFAULT_THEME})
|
|
29
29
|
--lang <id> 界面语言:zh / en / bilingual(默认 zh)
|
|
30
|
+
--motion <on|off> 页间转场与要点入场动画(默认 on;off 产出纯静态)
|
|
30
31
|
--out <dir> 输出目录(默认当前目录)
|
|
31
32
|
--file <name> 文件名前缀(默认取标题)
|
|
32
33
|
--list-themes 列出内置主题
|
|
@@ -39,7 +40,7 @@ const HELP = `dsh-ppt v0.1.0 —— 一句话 / 一篇文档 → HTML 放映 + P
|
|
|
39
40
|
`
|
|
40
41
|
|
|
41
42
|
export function parseArgv(argv) {
|
|
42
|
-
const args = { content: '', slides: null, lang: 'zh', theme: DEFAULT_THEME, out: '.', file: '', title: '' }
|
|
43
|
+
const args = { content: '', slides: null, lang: 'zh', theme: DEFAULT_THEME, motion: undefined, out: '.', file: '', title: '' }
|
|
43
44
|
const positional = []
|
|
44
45
|
for (let i = 0; i < argv.length; i += 1) {
|
|
45
46
|
const raw = String(argv[i])
|
|
@@ -59,6 +60,7 @@ export function parseArgv(argv) {
|
|
|
59
60
|
else if (key === '--slides') args.slides = JSON.parse(nextValue())
|
|
60
61
|
else if (key === '--theme') args.theme = nextValue()
|
|
61
62
|
else if (key === '--lang') args.lang = nextValue()
|
|
63
|
+
else if (key === '--motion') args.motion = nextValue()
|
|
62
64
|
else if (key === '--out') args.out = nextValue()
|
|
63
65
|
else if (key === '--file') args.file = nextValue()
|
|
64
66
|
else positional.push(raw)
|
|
@@ -105,6 +107,7 @@ export async function main(argv = process.argv.slice(2), io = {}) {
|
|
|
105
107
|
slides,
|
|
106
108
|
theme: args.theme,
|
|
107
109
|
lang: args.lang,
|
|
110
|
+
motion: args.motion,
|
|
108
111
|
outputDir: resolvePath(args.out || '.'),
|
|
109
112
|
fileName: args.file,
|
|
110
113
|
}
|
|
@@ -18,7 +18,7 @@ import { mkdirSync, writeFileSync } from 'node:fs'
|
|
|
18
18
|
import { resolve as resolvePath } from 'node:path'
|
|
19
19
|
import { deflateRawSync } from 'node:zlib'
|
|
20
20
|
|
|
21
|
-
export const DECK_VERSION = '0.
|
|
21
|
+
export const DECK_VERSION = '0.3.0'
|
|
22
22
|
|
|
23
23
|
// ---------------------------------------------------------------------------
|
|
24
24
|
// 主题
|
|
@@ -206,6 +206,13 @@ export function resolveLanguage(input) {
|
|
|
206
206
|
return language
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
+
export function resolveMotion(input) {
|
|
210
|
+
if (input === undefined || input === null || input === '') return true
|
|
211
|
+
if (input === true || input === 'on') return true
|
|
212
|
+
if (input === false || input === 'off') return false
|
|
213
|
+
throw new Error('dsh-ppt:未知 motion 值 "' + String(input) + '",可选:on / off(默认 on)')
|
|
214
|
+
}
|
|
215
|
+
|
|
209
216
|
export function listThemes(lang = 'zh') {
|
|
210
217
|
const pick = (pair) => (lang === 'en' ? pair.en : pair.zh)
|
|
211
218
|
return THEME_IDS.map((id) => {
|
|
@@ -626,6 +633,7 @@ export function normalizeBuildOptions(options = {}) {
|
|
|
626
633
|
if (title === '') throw new Error('dsh-ppt:title 不能为空')
|
|
627
634
|
const theme = resolveTheme(options.theme)
|
|
628
635
|
const language = resolveLanguage(options.lang)
|
|
636
|
+
const motion = resolveMotion(options.motion)
|
|
629
637
|
const maxSlides = clampInt(options.maxSlides, 60, 3, 120)
|
|
630
638
|
let deck
|
|
631
639
|
if (Array.isArray(options.slides) && options.slides.length > 0) {
|
|
@@ -646,12 +654,12 @@ export function normalizeBuildOptions(options = {}) {
|
|
|
646
654
|
if (deck.slides.length < 1) throw new Error('dsh-ppt:没有可生成的幻灯片')
|
|
647
655
|
const outputDir = resolvePath(String(options.outputDir ?? '.').trim() || '.')
|
|
648
656
|
const fileName = sanitizeFileName(options.fileName ?? title)
|
|
649
|
-
return { title, theme, language, deck, outputDir, fileName }
|
|
657
|
+
return { title, theme, language, motion, deck, outputDir, fileName }
|
|
650
658
|
}
|
|
651
659
|
|
|
652
660
|
export function buildDeck(options = {}) {
|
|
653
661
|
const normalized = normalizeBuildOptions(options)
|
|
654
|
-
const { title, theme, language, deck, outputDir, fileName } = normalized
|
|
662
|
+
const { title, theme, language, motion, deck, outputDir, fileName } = normalized
|
|
655
663
|
mkdirSync(outputDir, { recursive: true })
|
|
656
664
|
|
|
657
665
|
const manifest = {
|
|
@@ -659,6 +667,7 @@ export function buildDeck(options = {}) {
|
|
|
659
667
|
title,
|
|
660
668
|
theme: theme.id,
|
|
661
669
|
language: language.id,
|
|
670
|
+
motion,
|
|
662
671
|
slideCount: deck.slides.length,
|
|
663
672
|
slides: deck.slides,
|
|
664
673
|
}
|
|
@@ -696,6 +705,16 @@ export function renderHtml(manifest, theme, language) {
|
|
|
696
705
|
const t = theme
|
|
697
706
|
const lang = language
|
|
698
707
|
const ui = lang.ui
|
|
708
|
+
const motion = manifest.motion !== false
|
|
709
|
+
const motionCss = motion
|
|
710
|
+
? `body.motion .slide.is-active{animation:slide-in .45s cubic-bezier(.22,.8,.36,1)}
|
|
711
|
+
@keyframes slide-in{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:none}}
|
|
712
|
+
body.motion .bullets li{
|
|
713
|
+
opacity:0;animation:bullet-in .55s cubic-bezier(.22,.8,.36,1) forwards;
|
|
714
|
+
animation-delay:calc(var(--i, 0)*90ms + .12s);
|
|
715
|
+
}
|
|
716
|
+
@keyframes bullet-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}`
|
|
717
|
+
: ''
|
|
699
718
|
const slides = manifest.slides.map((slide, index) => renderHtmlSlide(slide, index, ui, lang.id)).join('\n')
|
|
700
719
|
const themeLabel = t.name[lang.id] ?? t.name.en
|
|
701
720
|
const total = manifest.slides.length
|
|
@@ -735,8 +754,8 @@ body{
|
|
|
735
754
|
radial-gradient(36% 30% at 12% 86%, ${hexToRgba(t.palette.accent2, t.dark ? 0.16 : 0.12)}, transparent 70%),
|
|
736
755
|
radial-gradient(70% 60% at 50% 50%, ${hexToRgba(t.palette.panel, 0.55)}, transparent 100%);
|
|
737
756
|
}
|
|
738
|
-
.slide.is-active{display:flex
|
|
739
|
-
|
|
757
|
+
.slide.is-active{display:flex}
|
|
758
|
+
${motionCss}
|
|
740
759
|
.kicker{
|
|
741
760
|
color:var(--accent);font-weight:700;letter-spacing:.18em;text-transform:uppercase;
|
|
742
761
|
font-size:clamp(12px,1.3vw,18px);margin-bottom:22px;
|
|
@@ -826,11 +845,12 @@ body.overview #notes-panel{display:none !important}
|
|
|
826
845
|
@media print{
|
|
827
846
|
html,body{height:auto;overflow:visible;background:#fff}
|
|
828
847
|
.slide{position:relative;display:block !important;height:100vh;page-break-after:always;padding:48px}
|
|
848
|
+
${motion ? 'body.motion .bullets li{opacity:1 !important;animation:none !important}' : ''}
|
|
829
849
|
#progress,#hud,#notes-panel{display:none !important}
|
|
830
850
|
}
|
|
831
851
|
</style>
|
|
832
852
|
</head>
|
|
833
|
-
<body>
|
|
853
|
+
<body class="${motion ? 'motion' : 'no-motion'}">
|
|
834
854
|
<div id="progress" aria-hidden="true"></div>
|
|
835
855
|
${slides}
|
|
836
856
|
<div id="hud" aria-live="polite">
|
|
@@ -979,7 +999,7 @@ function renderHtmlSlide(slide, index, ui, langId) {
|
|
|
979
999
|
default:
|
|
980
1000
|
inner = '<div class="kicker">' + escapeHtml(kicker) + '</div>' +
|
|
981
1001
|
'<h2>' + escapeHtml(title) + '</h2>' +
|
|
982
|
-
'<ul>' + bullets.map((bullet) => '<li>' + escapeHtml(bullet) + '</li>').join('') + '</ul>'
|
|
1002
|
+
'<ul>' + bullets.map((bullet, bulletIndex) => '<li style="--i:' + bulletIndex + '">' + escapeHtml(bullet) + '</li>').join('') + '</ul>'
|
|
983
1003
|
break
|
|
984
1004
|
}
|
|
985
1005
|
const notesAttr = typeof slide.notes === 'string' && slide.notes.trim() !== ''
|
|
@@ -1209,8 +1229,48 @@ function slideShapeList(slide, index, total, theme, langId) {
|
|
|
1209
1229
|
return shapes.join('')
|
|
1210
1230
|
}
|
|
1211
1231
|
|
|
1212
|
-
|
|
1232
|
+
/**
|
|
1233
|
+
* 原生逐条点击显现动画(PowerPoint「出现,按段落」的标准时序树):
|
|
1234
|
+
* bldP 把正文文本框标记为按段落构建,主序列里每条要点一个点击节点。
|
|
1235
|
+
*/
|
|
1236
|
+
function bulletTimingXml(spid, clicks) {
|
|
1237
|
+
let id = 2
|
|
1238
|
+
const nextId = () => { id += 1; return String(id) }
|
|
1239
|
+
const clickPars = []
|
|
1240
|
+
for (let i = 0; i < clicks; i += 1) {
|
|
1241
|
+
clickPars.push(
|
|
1242
|
+
'<p:par><p:cTn id="' + nextId() + '" fill="hold"><p:stCondLst><p:cond delay="indefinite"/></p:stCondLst><p:childTnLst>' +
|
|
1243
|
+
'<p:par><p:cTn id="' + nextId() + '" presetID="1" presetClass="entr" presetSubtype="0" fill="hold" grpId="0" nodeType="clickEffect">' +
|
|
1244
|
+
'<p:stCondLst><p:cond delay="0"/></p:stCondLst><p:childTnLst>' +
|
|
1245
|
+
'<p:set><p:cBhvr><p:cTn id="' + nextId() + '" dur="1" fill="hold"><p:stCondLst><p:cond delay="0"/></p:stCondLst></p:cTn>' +
|
|
1246
|
+
'<p:tgtEl><p:spTgt spid="' + spid + '"/></p:tgtEl>' +
|
|
1247
|
+
'<p:attrNameLst><p:attrName>style.visibility</p:attrName></p:attrNameLst></p:cBhvr>' +
|
|
1248
|
+
'<p:to><p:strVal val="visible"/></p:to></p:set>' +
|
|
1249
|
+
'</p:childTnLst></p:cTn></p:par>' +
|
|
1250
|
+
'</p:childTnLst></p:cTn></p:par>',
|
|
1251
|
+
)
|
|
1252
|
+
}
|
|
1253
|
+
return '<p:timing><p:tnLst><p:par>' +
|
|
1254
|
+
'<p:cTn id="1" dur="indefinite" restart="never" nodeType="tmRoot"><p:childTnLst>' +
|
|
1255
|
+
'<p:seq concurrent="1" nextAc="seek"><p:cTn id="2" dur="indefinite" nodeType="mainSeq"><p:childTnLst>' +
|
|
1256
|
+
clickPars.join('') +
|
|
1257
|
+
'</p:childTnLst></p:cTn>' +
|
|
1258
|
+
'<p:prevCondLst><p:cond evt="onPrev" delay="0"><p:tgtEl><p:sldTgt/></p:tgtEl></p:cond></p:prevCondLst>' +
|
|
1259
|
+
'<p:nextCondLst><p:cond evt="onNext" delay="0"><p:tgtEl><p:sldTgt/></p:tgtEl></p:cond></p:nextCondLst>' +
|
|
1260
|
+
'</p:seq></p:childTnLst></p:cTn></p:par></p:tnLst>' +
|
|
1261
|
+
'<p:bldLst><p:bldP spid="' + spid + '" grpId="0"/></p:bldLst></p:timing>'
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
function slideXml(slide, index, total, theme, langId, motion) {
|
|
1213
1265
|
const p = theme.palette
|
|
1266
|
+
let motionXml = ''
|
|
1267
|
+
if (motion) {
|
|
1268
|
+
motionXml = '<p:transition spd="med"><p:fade/></p:transition>'
|
|
1269
|
+
const bullets = Array.isArray(slide.bullets) ? slide.bullets : []
|
|
1270
|
+
if (slide.layout === 'bullets' && bullets.length >= 2) {
|
|
1271
|
+
motionXml += bulletTimingXml((index + 1) * 10 + 3, bullets.length)
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1214
1274
|
return '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' +
|
|
1215
1275
|
'<p:sld xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" ' +
|
|
1216
1276
|
'xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" ' +
|
|
@@ -1221,6 +1281,7 @@ function slideXml(slide, index, total, theme, langId) {
|
|
|
1221
1281
|
slideShapeList(slide, index, total, theme, langId) +
|
|
1222
1282
|
'</p:spTree></p:cSld>' +
|
|
1223
1283
|
'<p:clrMapOvr><a:overrideClrMapping bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/></p:clrMapOvr>' +
|
|
1284
|
+
motionXml +
|
|
1224
1285
|
'</p:sld>'
|
|
1225
1286
|
}
|
|
1226
1287
|
|
|
@@ -1530,6 +1591,7 @@ function crc32(buffer) {
|
|
|
1530
1591
|
export function buildPptx(manifest, themeInput, languageInput) {
|
|
1531
1592
|
const theme = themeInput?.id ? themeInput : resolveTheme(themeInput)
|
|
1532
1593
|
const language = languageInput?.id ? languageInput : resolveLanguage(languageInput)
|
|
1594
|
+
const motion = manifest.motion !== false
|
|
1533
1595
|
const slides = manifest.slides
|
|
1534
1596
|
const noteIndexes = []
|
|
1535
1597
|
slides.forEach((slide, index) => {
|
|
@@ -1555,7 +1617,7 @@ export function buildPptx(manifest, themeInput, languageInput) {
|
|
|
1555
1617
|
}
|
|
1556
1618
|
slides.forEach((slide, index) => {
|
|
1557
1619
|
const hasNotes = noteIndexes.includes(index)
|
|
1558
|
-
entries.push({ name: 'ppt/slides/slide' + (index + 1) + '.xml', data: slideXml(slide, index, slides.length, theme, language.id) })
|
|
1620
|
+
entries.push({ name: 'ppt/slides/slide' + (index + 1) + '.xml', data: slideXml(slide, index, slides.length, theme, language.id, motion) })
|
|
1559
1621
|
entries.push({ name: 'ppt/slides/_rels/slide' + (index + 1) + '.xml.rels', data: slideRelXml(hasNotes, index + 1) })
|
|
1560
1622
|
if (hasNotes) {
|
|
1561
1623
|
entries.push({ name: 'ppt/notesSlides/notesSlide' + (index + 1) + '.xml', data: notesSlideXml(slide.notes) })
|