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 变更
This commit is contained in:
@@ -60,17 +60,17 @@ Page Description功能允许用户为文档元数据、模板和幻灯片添加
|
||||
|
||||
### Requirement: description字段不得影响渲染逻辑
|
||||
|
||||
系统 SHALL 在渲染过程中忽略 `description` 字段,不影响最终的PPTX输出。
|
||||
系统 SHALL 在渲染幻灯片时忽略 `description` 字段对视觉元素的影响,但会将幻灯片级别的 `description` 写入 PPTX 备注页。
|
||||
|
||||
#### Scenario: 渲染包含description的模板
|
||||
|
||||
- **WHEN** 系统渲染包含 `description` 字段的模板
|
||||
- **THEN** description不参与元素渲染,不影响输出结果
|
||||
- **THEN** description不参与元素渲染,不影响幻灯片视觉输出
|
||||
|
||||
#### Scenario: 渲染包含description的幻灯片
|
||||
|
||||
- **WHEN** 系统渲染包含 `description` 字段的幻灯片
|
||||
- **THEN** description不写入PPTX文件,不影响输出结果
|
||||
- **THEN** description写入PPTX文件的备注页,不影响幻灯片视觉输出
|
||||
|
||||
### Requirement: YAML解析器必须正确解析description字段
|
||||
|
||||
|
||||
58
openspec/specs/pptx-slide-notes/spec.md
Normal file
58
openspec/specs/pptx-slide-notes/spec.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# PPTX Slide Notes
|
||||
|
||||
## Purpose
|
||||
|
||||
PPTX 备注功能允许用户在生成 PPTX 文件时,将幻灯片的 description 字段内容写入备注页。备注页是 PPT 的原生演讲者工具,在演示时可以查看但不显示给观众,非常适合存储演讲说明和备注信息。
|
||||
|
||||
## 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 备注页显示正确的中文内容
|
||||
Reference in New Issue
Block a user