openxml-text-updates
星标8
分支0
更新时间2026年3月25日 05:16
Preserve PowerPoint formatting when replacing text in existing shapes
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
SKILL.md
readonly菜单
Preserve PowerPoint formatting when replacing text in existing shapes
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
{what this skill teaches agents}
{what this skill teaches agents}
Patterns for exporting PPTX presentations to markdown
Build realistic PPTX fixtures for service and tool tests
| name | openxml-text-updates |
| description | Preserve PowerPoint formatting when replacing text in existing shapes |
| domain | openxml-updates |
| confidence | high |
| source | issue-19 implementation |
Use this pattern when a pptx-tools feature needs to replace text in an existing PowerPoint shape without breaking formatting or package structure.
pptx_get_slide_content metadata, preferring the shape name (p:cNvPr/@name) and using a deterministic index fallback only when needed.p:sp elements instead of recreating the slide shape.TextBody's BodyProperties and ListStyle before replacing content.TextBody, insert a new one in the same structural slot PowerPoint expects: after spPr/style and before extLst.PresentationDocument once, reuse the same slide-id snapshot for every mutation, and save each touched slide only once after the batch finishes.var existingTextBody = shape.TextBody ?? new TextBody(
new A.BodyProperties(),
new A.ListStyle(),
new A.Paragraph(new A.EndParagraphRunProperties()));
var replacementTextBody = new TextBody(
(A.BodyProperties)existingTextBody.BodyProperties.CloneNode(true),
(A.ListStyle)existingTextBody.ListStyle.CloneNode(true));
A.Run(new A.Text(...)) unless you are willing to lose paragraph and run formatting..pptx once per mutation when a workflow can batch several text updates together.