PPTX Notes Editor
Workflow Decision Tree
CODEBLOCK0
1. Unpack PPTX
CODEBLOCK1
File Structure:
CODEBLOCK2
2. Confirm Slide-to-Notes Mapping
Important: The numbering of notesSlideN.xml does NOT necessarily correspond to PPT page numbers! You MUST confirm via the relationship files.
Method 1: Check Precise Mapping (Recommended)
CODEBLOCK3
Method 2: Quick View All Mappings
CODEBLOCK4
Edge Cases
- - Slide has no notes: grep returns no output, this slide has no notes
- Notes file exists but no corresponding slide: may be orphaned notes, can be ignored
3. Read Notes Content
XML Namespace Reference
PPTX XML uses these namespace prefixes:
- -
a: - DrawingML namespace (text, shapes) - INLINECODE2 - PresentationML namespace (slide structure)
- INLINECODE3 - Relationships namespace
Notes text is inside <a:t> tags.
Method 1: Read Page by Page
CODEBLOCK5
Method 2: Batch Extract All Notes Text
CODEBLOCK6
Method 3: Extract Single Page Notes by File
CODEBLOCK7
Handling XML Escaped Characters
Notes text may contain these escape sequences:
- -
< → INLINECODE6 - INLINECODE7 → INLINECODE8
- INLINECODE9 → INLINECODE10
- INLINECODE11 → INLINECODE12
Decode with sed:
CODEBLOCK8
4. Rewrite in Narrative Style
Narrative Style Guidelines
- - Tell a story with beginning, development, turning point, and conclusion
- Conversational and natural transitions
- Specific examples and scenarios as support
- Create empathy and engagement with the audience
Important Notes
- - MUST confirm before modifying: After generating notes draft, show it to the user and get explicit confirmation before executing any XML modification. Do NOT modify any notes without user confirmation
- If the original PPT notes are dry bullet-point lists, you need to completely rewrite them in narrative style
- If the original notes are already in narrative style, you can refine and improve them
- Do NOT assume "keep the original style" - determine the style based on the target presentation context
Modification Process
Step 0: Ask user to select page range and notes style
Present the user with the following choices before starting:
Page Range Selection:
- - All pages
- Only pages without notes
- Only pages with existing notes
- Custom range (user inputs e.g. "1-5,8,10-12")
Notes Style Selection:
- - Narrative style (storytelling, conversational, with beginning/development/climax/conclusion)
- Concise bullet points (distill key information, brief and powerful)
- Verbatim script (complete spoken script that can be read aloud directly)
- Custom style (user describes desired style)
Language Selection (optional):
- - Keep original language
- Chinese
- English
Step 1: Read through entire PPT content (build global context)
Before modifying page by page, you MUST read through all slides to build global context:
CODEBLOCK9
After reading, present a global overview to the user:
CODEBLOCK10
Purpose of reading through:
- - Understand the overall narrative arc and logical structure
- Know each page's role (setup, core argument, case study, turning point, summary)
- Avoid content duplication or logical gaps between notes
- Provide contextual support for subsequent page-by-page design
Step 2+: Page-by-page modification
- 1. Based on selected page range, read slide content summary page by page (extract key text from slideN.xml)
- Read current notes (from corresponding notesSlide), leverage Step 1's global context to understand this page's role
- Show both to user in this format:
CODEBLOCK11
- 4. Generate notes draft according to user's selected style, present to user
- MUST wait for user's explicit confirmation before modifying
<a:t> text in XML. Do NOT execute any modification without user confirmation - Get user confirmation before moving to next page
XML Modification Notes
- - Require exact string matching when modifying XML
- Newlines in XML may display as literal INLINECODE14
- Recommend searching file content first to confirm exact string
CODEBLOCK12
Example:
CODEBLOCK13
Handling Multiple Paragraphs
If notes contain multiple paragraphs, there will be multiple <a:t> tags:
CODEBLOCK14
Modify each <a:t> tag separately.
Batch Operations Guide
If you need to uniformly modify similar content in multiple places:
- 1. Search file content to confirm all locations that need modification
- Modify each one individually
- Verify after each modification
5. Pack PPTX
CODEBLOCK15
6. Verify Modifications
CODEBLOCK16
7. Export to MD
Extract Slide Titles
CODEBLOCK17
Export Format
Organize all page notes into a single MD file:
CODEBLOCK18
Correct Export Script (Based on Actual Mapping)
CODEBLOCK19
Appendix: Troubleshooting
Issue: PPT Won't Open After Modification
- - Cause: XML structure was corrupted (e.g., unclosed tags, special characters not escaped)
- Solution: When modifying XML, ensure complete
<a:t>...</a:t> structure is preserved
Issue: Modified Text Has No Effect
- - Cause: Modified the wrong notesSlide file
- Solution: Re-confirm the mapping between slideN.xml and notesSlide
Issue: Text Contains Special Characters
- - Cause: Characters like
& < > " need escaping - Solution: When modifying, ensure these characters are properly escaped as INLINECODE19
Complete Example
CODEBLOCK20
Reuse Checklist
- - [ ] Unpack PPTX to pptx-unpacked
- [ ] Confirm slide-to-notes mapping
- [ ] Determine modification scope (all/some pages)
- [ ] Confirm narrative style requirements
- [ ] Modify page by page with user confirmation
- [ ] Pack PPTX after modification
- [ ] Verify modifications took effect
- [ ] Export to MD if needed
PPTX 备注编辑器
工作流程决策树
用户请求
├── 修改备注 → 1,2,3,4,5,6
├── 仅导出为MD → 1,2 → 7
├── 仅打包现有内容 → 5 (可选验证 → 6)
└── 仅解包查看 → 1
1. 解包PPTX
bash
解包到指定目录
mkdir -p pptx-unpacked && unzip your-presentation.pptx -d pptx-unpacked
文件结构:
pptx-unpacked/
├── ppt/
│ ├── slides/ # 幻灯片
│ │ ├── slide1.xml
│ │ ├── slide2.xml
│ │ └── _rels/ # 幻灯片关系文件
│ │ ├── slide1.xml.rels
│ │ └── slide2.xml.rels
│ ├── notesSlides/ # 备注文件
│ │ ├── notesSlide1.xml
│ │ └── notesSlide2.xml
│ └── _rels/
│ └── presentation.xml.rels
└── [Content_Types].xml
2. 确认幻灯片与备注的映射关系
重要提示:notesSlideN.xml 的编号不一定对应PPT页码!必须通过关系文件确认。
方法一:检查精确映射(推荐)
bash
检查幻灯片N对应的备注文件
cat pptx-unpacked/ppt/slides/_rels/slideN.xml.rels | grep -i notesSlide
示例输出:
这意味着 slideN.xml 对应 notesSlide2.xml
方法二:快速查看所有映射
bash
列出所有幻灯片与备注的对应关系
for f in pptx-unpacked/ppt/slides/_rels/slide*.xml.rels; do
slide=$(basename $f .xml.rels)
notes=$(grep -o notesSlide[0-9]*\.xml $f | head -1)
if [ -n $notes ]; then
echo $slide -> $notes
fi
done
边界情况
- - 幻灯片无备注:grep无输出,表示该幻灯片没有备注
- 备注文件存在但无对应幻灯片:可能是孤立备注,可忽略
3. 读取备注内容
XML命名空间参考
PPTX XML使用以下命名空间前缀:
- - a: - DrawingML命名空间(文本、形状)
- p: - PresentationML命名空间(幻灯片结构)
- r: - 关系命名空间
备注文本位于 标签内。
方法一:逐页读取
bash
列出所有备注文件
ls pptx-unpacked/ppt/notesSlides/
使用文件读取工具读取单个备注文件
备注文本在 标签中
方法二:批量提取所有备注文本
bash
从所有备注文件中提取文本(macOS兼容)
grep -oh
[^<] pptx-unpacked/ppt/notesSlides/.xml | sed s/
\([^<]*\)<\/a:t>/\1/g | head -50
方法三:按文件提取单页备注
bash
从 notesSlide2.xml 提取所有文本(macOS兼容)
grep -oh [^<] pptx-unpacked/ppt/notesSlides/notesSlide2.xml | sed s/\([^<]\)<\/a:t>/\1/g
处理XML转义字符
备注文本可能包含以下转义序列:
使用sed解码:
bash
sed s/<//g; s/&/\&/g; s/"//g
4. 以叙事风格重写
叙事风格指南
- - 讲述一个有开头、发展、转折和结尾的故事
- 对话式、自然的过渡
- 用具体例子和场景作为支撑
- 与听众建立共鸣和互动
重要说明
- - 修改前必须确认:生成备注草稿后,向用户展示并获取明确确认,然后才能执行任何XML修改。未经用户确认,不得修改任何备注
- 如果原始PPT备注是干巴巴的要点列表,需要完全重写为叙事风格
- 如果原始备注已经是叙事风格,可以进行润色和改进
- 不要假设保持原始风格——根据目标演示上下文确定风格
修改流程
第0步:请用户选择页面范围和备注风格
在开始之前,向用户呈现以下选项:
页面范围选择:
- - 所有页面
- 仅无备注的页面
- 仅已有备注的页面
- 自定义范围(用户输入,如1-5,8,10-12)
备注风格选择:
- - 叙事风格(讲故事、对话式,有开头/发展/高潮/结尾)
- 简洁要点(提炼关键信息,简短有力)
- 逐字稿(完整的口语脚本,可直接朗读)
- 自定义风格(用户描述所需风格)
语言选择(可选):
第1步:通读整个PPT内容(建立全局上下文)
在逐页修改之前,必须通读所有幻灯片以建立全局上下文:
bash
从所有幻灯片批量提取文本摘要(macOS兼容)
for f in pptx-unpacked/ppt/slides/slide*.xml; do
slide=$(basename $f .xml)
echo === $slide ===
grep -oh [^<] $f | sed s/\([^<]\)<\/a:t>/\1/g
echo
done
阅读后,向用户呈现全局概览:
[PPT全局概览]
总计:X页,主题:xxx
第1页:开场 - xxx
第2页:背景 - xxx
第3页:核心论点 - xxx
...
第X页:总结 - xxx
叙事弧线:xxx → xxx → xxx
通读的目的:
- - 理解整体叙事弧线和逻辑结构
- 了解每页的角色(铺垫、核心论点、案例研究、转折点、总结)
- 避免备注之间的内容重复或逻辑断层
- 为后续逐页设计提供上下文支持
第2步+:逐页修改
- 1. 根据所选页面范围,逐页读取幻灯片内容摘要(从slideN.xml提取关键文本)
- 读取当前备注(从对应的notesSlide),利用第1步的全局上下文理解本页的角色
- 以以下格式向用户展示两者:
--- 第N页 ---
[幻灯片内容]
标题:xxx
要点:aaa, bbb, ccc
图表:[如有,简要描述]
[当前备注]
(显示完整的现有备注,如为空则显示无)
- 4. 根据用户选择的风格生成备注草稿,呈现给用户
- 必须等待用户明确确认后才能修改XML中的 文本。未经用户确认,不得执行任何修改
- 在进入下一页之前获取用户确认
XML修改说明
- - 修改XML时需要精确字符串匹配
- XML中的换行符可能显示为字面量 \n
- 建议先搜索文件内容以确认精确字符串
xml
旧文本 → 新文本
示例:
xml
这是旧的备注内容
这是新的备注内容
处理多段落
如果备注包含多个段落,会有多个 标签:
xml
第一段
第二段
分别修改每个 标签。
批量操作指南
如果需要统一修改多个位置的相似内容:
- 1. 搜索文件内容,确认