1
0
Files
PPTX/openspec/changes/archive/2026-03-04-add-slide-notes/specs/pptx-slide-notes/spec.md
lanyuanxiaoyao 7ef29ea039 feat: 实现幻灯片备注功能,将description写入PPT备注页
- 添加 PptxGenerator._set_notes() 方法设置备注
- 在 add_slide() 中调用 _set_notes() 处理 description
- 仅幻灯片级别的 description 写入备注,不继承模板
- 添加备注功能测试用例(8个测试)
- 更新 README.md 和 README_DEV.md 文档
- 新建 pptx-slide-notes spec
- 更新 page-description spec 允许写入备注
- 归档 add-slide-notes 变更
2026-03-04 14:47:03 +08:00

53 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## ADDED Requirements
### Requirement: 幻灯片description必须写入PPT备注页
系统 SHALL 在生成 PPTX 时,将幻灯片的 `description` 字段内容写入该幻灯片的备注页。
#### Scenario: 幻灯片包含description
- **WHEN** 幻灯片定义了 `description: "这是幻灯片的演讲说明"`
- **THEN** PPTX 幻灯片的备注页包含该文本内容
#### Scenario: description包含多行文本
- **WHEN** 幻灯片的 description 使用 YAML 多行文本格式定义
- **THEN** 备注页保留完整的文本内容,包括换行符
#### Scenario: description为空字符串
- **WHEN** 幻灯片定义了 `description: ""`
- **THEN** 备注页设置为空字符串(不为 None
### Requirement: 无description时不设置备注
系统 SHALL 在幻灯片没有 `description` 字段时不设置备注内容。
#### Scenario: 幻灯片不包含description
- **WHEN** 幻灯片定义未包含 `description` 字段
- **THEN** PPTX 幻灯片不设置备注,使用默认空备注页
### Requirement: 模板description不写入备注
系统 SHALL 仅处理幻灯片级别的 `description`,不使用模板的 `description`
#### Scenario: 模板有description但幻灯片没有
- **WHEN** 模板定义了 `description: "模板说明"` 但幻灯片未定义 `description`
- **THEN** PPTX 幻灯片不设置备注,不继承模板的 description
#### Scenario: 模板和幻灯片都有description
- **WHEN** 模板定义了 `description` 且幻灯片也定义了 `description`
- **THEN** PPTX 幻灯片备注仅包含幻灯片的 description忽略模板的 description
### Requirement: description必须支持中文字符
系统 SHALL 支持在 `description` 字段中使用中文字符,并正确写入 PPTX 备注。
#### Scenario: description包含中文
- **WHEN** 幻灯片的 description 包含中文字符,如 "这是演讲备注内容"
- **THEN** 系统正确处理PPTX 备注页显示正确的中文内容