@hfyjq/crannia 1.1.1 → 1.2.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.
Files changed (306) hide show
  1. package/LICENSE +201 -201
  2. package/NOTICE +48 -45
  3. package/README.md +1 -1
  4. package/THIRD-PARTY-FRONTEND.md +5266 -5266
  5. package/THIRD-PARTY-PYTHON-linux.md +174 -0
  6. package/THIRD-PARTY-PYTHON.md +176 -162
  7. package/THIRD-PARTY.md +323 -316
  8. package/apps/desktop/quotes.txt +56 -56
  9. package/bus/core.py +677 -671
  10. package/bus/loaders/channel_loader.py +64 -64
  11. package/bus/loaders/provider_loader.py +4 -7
  12. package/bus/loaders/skill_loader.py +46 -27
  13. package/bus/loaders/skill_md.py +9 -9
  14. package/bus/mcp_disabled.py +4 -6
  15. package/bus/quarantine.py +10 -13
  16. package/bus/registry.py +2315 -2284
  17. package/bus/skill_state.py +124 -124
  18. package/channels/cli_channel/handler.py +3 -3
  19. package/channels/cli_channel/manifest.yaml +5 -5
  20. package/channels/dingtalk_channel/handler.py +32 -32
  21. package/channels/dingtalk_channel/manifest.yaml +12 -12
  22. package/channels/feishu_channel/handler.py +33 -33
  23. package/channels/feishu_channel/manifest.yaml +12 -12
  24. package/channels/qq_bot_channel/__init__.py +1 -1
  25. package/channels/qq_bot_channel/handler.py +24 -24
  26. package/channels/qq_bot_channel/manifest.yaml +4 -4
  27. package/channels/telegram_channel/__init__.py +1 -1
  28. package/channels/telegram_channel/handler.py +21 -21
  29. package/channels/telegram_channel/manifest.yaml +4 -4
  30. package/channels/telegram_channel/media.py +231 -231
  31. package/channels/textfmt.py +58 -58
  32. package/channels/wechat_channel/__init__.py +1 -1
  33. package/channels/wechat_channel/converter.py +1 -1
  34. package/channels/wechat_channel/handler.py +8 -8
  35. package/channels/wechat_channel/manifest.yaml +5 -5
  36. package/channels/wechat_channel/media.py +178 -178
  37. package/core/activity.py +753 -709
  38. package/core/agent_loop.py +7673 -7523
  39. package/core/allowlist.py +2 -3
  40. package/core/approval.py +36 -26
  41. package/core/approval_timeout.py +256 -228
  42. package/core/artifacts.py +3 -3
  43. package/core/attachment_gc.py +21 -0
  44. package/core/auto_review.py +2 -2
  45. package/core/browser/cdp.py +5 -2
  46. package/core/browser/discover.py +55 -19
  47. package/core/browser/session.py +4 -4
  48. package/core/cache_break_detector.py +97 -0
  49. package/core/cache_breakpoints.py +103 -0
  50. package/core/cache_policies.py +255 -0
  51. package/core/cancellation.py +3 -3
  52. package/core/channel_configs.py +3 -3
  53. package/core/channel_turns.py +13 -13
  54. package/core/child_approval.py +2 -3
  55. package/core/code_intel.py +11 -11
  56. package/core/command_policy.py +13 -7
  57. package/core/computer/annotate.py +231 -11
  58. package/core/computer/capture.py +140 -1
  59. package/core/computer/guard.py +7 -4
  60. package/core/computer/input.py +452 -26
  61. package/core/computer/session.py +563 -381
  62. package/core/computer/tools.py +2170 -928
  63. package/core/computer/uia.py +100 -1
  64. package/core/computer/watch.py +1 -1
  65. package/core/computer/win32.py +302 -7
  66. package/core/config_requirements.py +205 -205
  67. package/core/cron/runner.py +4 -4
  68. package/core/daily_log.py +2 -2
  69. package/core/dedup.py +2 -2
  70. package/core/egress_channels.py +326 -0
  71. package/core/egress_gate.py +96 -8
  72. package/core/egress_preapproved.py +59 -3
  73. package/core/endpoint.py +141 -141
  74. package/core/events.py +17 -8
  75. package/core/extension.py +2 -2
  76. package/core/file_history.py +15 -15
  77. package/core/file_tools.py +3 -3
  78. package/core/github_config.py +1 -1
  79. package/core/group_digest.py +3 -4
  80. package/core/group_minutes.py +5 -5
  81. package/core/group_reply.py +24 -0
  82. package/core/groups.py +5 -9
  83. package/core/hooks.py +15 -15
  84. package/core/i18n.py +2 -2
  85. package/core/ice/canary.py +3 -3
  86. package/core/ice/net_heuristics.py +2 -2
  87. package/core/im_routing.py +3 -3
  88. package/core/image_input.py +183 -43
  89. package/core/inbound.py +3 -3
  90. package/core/jobs.py +6 -6
  91. package/core/last_good.py +150 -150
  92. package/core/leaf_md.py +3 -3
  93. package/core/llm_errors.py +37 -28
  94. package/core/mail_config.py +2 -2
  95. package/core/memory/compressor.py +8 -8
  96. package/core/memory/manager.py +30 -45
  97. package/core/memory/session_memory.py +1 -2
  98. package/core/memory/short_term.py +4 -4
  99. package/core/memory_extract.py +1 -1
  100. package/core/memory_organize.py +8 -8
  101. package/core/memory_store.py +7 -9
  102. package/core/memory_transfer.py +2 -2
  103. package/core/model_capabilities.py +2 -2
  104. package/core/model_configs.py +219 -68
  105. package/core/model_profiles.py +333 -0
  106. package/core/modes.py +12 -11
  107. package/core/net_proxy.py +3 -3
  108. package/core/pipeline/scheduler.py +48 -43
  109. package/core/pipeline/stage.py +3 -0
  110. package/core/pipeline/stages/agent_loop.py +36 -15
  111. package/core/pipeline/stages/group_reply.py +22 -20
  112. package/core/pipeline/stages/post_process.py +7 -7
  113. package/core/pipeline/stages/pre_process.py +369 -77
  114. package/core/prompt_assembler.py +13 -4
  115. package/core/recycle.py +227 -16
  116. package/core/response_language.py +1 -1
  117. package/core/retention.py +2 -2
  118. package/core/rg.py +4 -3
  119. package/core/security.py +26 -8
  120. package/core/services.py +8 -8
  121. package/core/session_model.py +3 -5
  122. package/core/session_pool.py +35 -5
  123. package/core/session_recap.py +40 -3
  124. package/core/session_workspace.py +2 -3
  125. package/core/settings_baseline.py +2 -2
  126. package/core/settings_transfer.py +25 -1
  127. package/core/shell.py +52 -20
  128. package/core/side_call.py +3 -3
  129. package/core/skill_config.py +164 -0
  130. package/core/skill_factory.py +2 -2
  131. package/core/skill_guidance.py +2 -4
  132. package/core/skill_index.py +3 -4
  133. package/core/skill_settings.py +1 -1
  134. package/core/skill_sources.py +7 -7
  135. package/core/ssh_config.py +129 -0
  136. package/core/state_registry.py +67 -5
  137. package/core/subagent.py +28 -5
  138. package/core/subagent_defs.py +3 -3
  139. package/core/summarizer.py +4 -5
  140. package/core/tasks_notify.py +6 -6
  141. package/core/tiers.py +2 -2
  142. package/core/todos.py +1 -1
  143. package/core/token_calibrator.py +1 -4
  144. package/core/tool_outcome.py +108 -108
  145. package/core/touched_files.py +1 -1
  146. package/core/trace.py +12 -3
  147. package/core/unlock.py +4 -4
  148. package/core/update_tui.py +184 -158
  149. package/core/updater.py +5 -3
  150. package/core/version.py +14 -14
  151. package/core/vision_budget.py +235 -0
  152. package/core/web_cache.py +152 -152
  153. package/core/web_request.py +474 -0
  154. package/core/window_estimate.py +1 -1
  155. package/core/workspace.py +56 -26
  156. package/crannia_tray.py +278 -278
  157. package/licenses/GPL-3.0.txt +619 -619
  158. package/licenses/LGPL-2.1.txt +502 -502
  159. package/licenses/LGPL-3.0.txt +165 -165
  160. package/licenses/MIT-chat-on-wechat.txt +18 -18
  161. package/licenses/MIT-deepseek-harness.txt +21 -21
  162. package/licenses/Molio-LICENSE.txt +44 -44
  163. package/locales/en.json +1876 -1762
  164. package/main.py +154 -154
  165. package/mcpx/client.py +12 -1
  166. package/mcpx/manager.py +530 -522
  167. package/mcpx/servers/web_search.py +5 -13
  168. package/package.json +15 -23
  169. package/providers/anthropic/client.py +35 -33
  170. package/providers/base.py +13 -13
  171. package/providers/cache_policies.json +294 -0
  172. package/providers/cost_table.json +3779 -3779
  173. package/providers/lmstudio/client.py +2 -2
  174. package/providers/model_capabilities.json +6665 -6665
  175. package/providers/model_profiles.json +629 -0
  176. package/providers/ollama/client.py +2 -2
  177. package/providers/openai_compat.py +37 -16
  178. package/providers/openrouter/client.py +2 -2
  179. package/providers/qwen/__init__.py +1 -1
  180. package/providers/qwen/client.py +2 -2
  181. package/providers/qwen/manifest.yaml +16 -16
  182. package/providers/rate_limiter.py +2 -2
  183. package/providers/siliconflow/client.py +2 -2
  184. package/providers/validation.py +171 -171
  185. package/providers/vision_profiles.json +89 -0
  186. package/providers/window_table.json +8909 -8909
  187. package/requirements.txt +59 -51
  188. package/sbom-linux-x64.json +4580 -0
  189. package/sbom.json +4600 -4413
  190. package/skills/diagram/SKILL.md +47 -0
  191. package/skills/diagram/__init__.py +1 -0
  192. package/skills/diagram/handler.py +294 -0
  193. package/skills/diagram/layout.py +174 -0
  194. package/skills/diagram/manifest.yaml +106 -0
  195. package/skills/diagram/mermaid.py +170 -0
  196. package/skills/diagram/svg.py +223 -0
  197. package/skills/entertainment/SKILL.md +35 -35
  198. package/skills/entertainment/__init__.py +1 -1
  199. package/skills/entertainment/handler.py +91 -91
  200. package/skills/entertainment/manifest.yaml +26 -26
  201. package/skills/file_parser/GUIDANCE.md +10 -10
  202. package/skills/file_parser/handler.py +33 -11
  203. package/skills/github/SKILL.md +32 -32
  204. package/skills/github/__init__.py +1 -1
  205. package/skills/mail_parser/SKILL.md +68 -68
  206. package/skills/mail_parser/__init__.py +1 -1
  207. package/skills/mail_parser/handler.py +1 -1
  208. package/skills/media_gen/GUIDANCE.md +19 -19
  209. package/skills/media_gen/SKILL.md +43 -43
  210. package/skills/media_gen/__init__.py +1 -1
  211. package/skills/media_gen/handler.py +1 -1
  212. package/skills/media_gen/manifest.yaml +93 -93
  213. package/skills/netops/SKILL.md +45 -0
  214. package/skills/netops/__init__.py +1 -0
  215. package/skills/netops/handler.py +418 -0
  216. package/skills/netops/manifest.yaml +118 -0
  217. package/skills/office_parser/_excel_io.py +3 -3
  218. package/skills/office_parser/handler.py +2 -2
  219. package/skills/office_parser/ppt_tools.py +1 -1
  220. package/skills/office_parser/pptx_export/console_encoding.py +27 -27
  221. package/skills/office_parser/pptx_export/resource_paths.py +88 -88
  222. package/skills/office_parser/pptx_export/svg_finalize/__init__.py +12 -12
  223. package/skills/office_parser/pptx_export/svg_finalize/crop_images.py +366 -366
  224. package/skills/office_parser/pptx_export/svg_finalize/embed_images.py +288 -288
  225. package/skills/office_parser/pptx_export/svg_finalize/fix_image_aspect.py +388 -388
  226. package/skills/office_parser/pptx_export/svg_finalize/flatten_tspan.py +818 -818
  227. package/skills/office_parser/pptx_export/svg_finalize/svg_rect_to_path.py +345 -345
  228. package/skills/office_parser/pptx_export/svg_to_pptx/__init__.py +14 -14
  229. package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/__init__.py +1 -1
  230. package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/context.py +186 -186
  231. package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/converter.py +781 -781
  232. package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/paths.py +429 -429
  233. package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/utils.py +40 -21
  234. package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/__init__.py +1 -1
  235. package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/builder.py +1267 -1267
  236. package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/dimensions.py +155 -155
  237. package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/discovery.py +101 -101
  238. package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/narration.py +236 -236
  239. package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/notes.py +257 -257
  240. package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/slide_xml.py +136 -136
  241. package/skills/office_parser/pptx_export/svg_to_pptx/tspan_flattener.py +44 -44
  242. package/skills/office_parser/pptx_export/svg_to_pptx/use_expander.py +129 -129
  243. package/skills/office_parser/references/LICENSE-Office-Word-MCP-Server.txt +20 -20
  244. package/skills/office_parser/references/LICENSE-excel-mcp-server.txt +21 -21
  245. package/skills/office_parser/references/layout_library.md +816 -816
  246. package/skills/office_parser/references/ppt-master/LICENSE +21 -21
  247. package/skills/office_parser/references/ppt-master/references/executor-base.md +474 -474
  248. package/skills/office_parser/references/ppt-master/references/shared-standards.md +1002 -1002
  249. package/skills/office_parser/references/ppt-master/references/strategist.md +880 -880
  250. package/skills/office_parser/references/ppt-master/references/template-designer.md +402 -402
  251. package/skills/office_parser/references/ppt-master/references/visual-review.md +240 -240
  252. package/skills/office_parser/references/ppt-master/references/visual-styles/_index.md +106 -106
  253. package/skills/office_parser/references/ppt-master/references/visual-styles/blueprint.md +37 -37
  254. package/skills/office_parser/references/ppt-master/references/visual-styles/brutalist.md +38 -38
  255. package/skills/office_parser/references/ppt-master/references/visual-styles/chalkboard.md +36 -36
  256. package/skills/office_parser/references/ppt-master/references/visual-styles/dark-tech.md +37 -37
  257. package/skills/office_parser/references/ppt-master/references/visual-styles/data-journalism.md +36 -36
  258. package/skills/office_parser/references/ppt-master/references/visual-styles/editorial.md +38 -38
  259. package/skills/office_parser/references/ppt-master/references/visual-styles/glassmorphism.md +36 -36
  260. package/skills/office_parser/references/ppt-master/references/visual-styles/ink-notes.md +37 -37
  261. package/skills/office_parser/references/ppt-master/references/visual-styles/ink-wash.md +36 -36
  262. package/skills/office_parser/references/ppt-master/references/visual-styles/memphis.md +37 -37
  263. package/skills/office_parser/references/ppt-master/references/visual-styles/paper-cut.md +36 -36
  264. package/skills/office_parser/references/ppt-master/references/visual-styles/photo-editorial.md +38 -38
  265. package/skills/office_parser/references/ppt-master/references/visual-styles/pixel-art.md +36 -36
  266. package/skills/office_parser/references/ppt-master/references/visual-styles/sketch-notes.md +36 -36
  267. package/skills/office_parser/references/ppt-master/references/visual-styles/soft-rounded.md +37 -37
  268. package/skills/office_parser/references/ppt-master/references/visual-styles/swiss-minimal.md +38 -38
  269. package/skills/office_parser/references/ppt-master/references/visual-styles/vintage-poster.md +36 -36
  270. package/skills/office_parser/references/ppt-master/references/visual-styles/zine.md +37 -37
  271. package/skills/office_parser/references/spec_lock.md +235 -235
  272. package/skills/office_parser/soffice.py +68 -68
  273. package/skills/office_parser/word_tools.py +3 -3
  274. package/skills/ssh/SKILL.md +81 -0
  275. package/skills/ssh/__init__.py +1 -0
  276. package/skills/ssh/handler.py +609 -0
  277. package/skills/ssh/manifest.yaml +182 -0
  278. package/tui/crannia.cmd +134 -134
  279. package/tui/crannia.sh +82 -0
  280. package/tui/crannia_tui/__init__.py +1 -1
  281. package/tui/crannia_tui/app.py +240 -17
  282. package/tui/crannia_tui/app.tcss +21 -0
  283. package/tui/crannia_tui/clipboard.py +78 -10
  284. package/tui/crannia_tui/commands.py +37 -0
  285. package/tui/crannia_tui/events.py +6 -0
  286. package/tui/crannia_tui/i18n.py +164 -164
  287. package/tui/crannia_tui/locales/en.json +32 -7
  288. package/tui/crannia_tui/paths.py +4 -1
  289. package/tui/crannia_tui/profile.py +178 -169
  290. package/tui/crannia_tui/settings.py +134 -134
  291. package/tui/crannia_tui/setup.py +44 -5
  292. package/tui/crannia_tui/ui.py +156 -16
  293. package/tui/crannia_tui/update.py +393 -389
  294. package/vendor/ripgrep/COPYING.txt +3 -3
  295. package/vendor/ripgrep/LICENSE-MIT.txt +21 -21
  296. package/vendor/ripgrep/NOTICE-vscode-ripgrep.txt +13 -13
  297. package/vendor/ripgrep/README.md +30 -14
  298. package/vendor/ripgrep/UNLICENSE.txt +24 -24
  299. package/vendor/ripgrep/linux-x64/rg +0 -0
  300. package/vendor/ripgrep/package-source.json +15 -16
  301. package/web/__main__.py +12 -15
  302. package/web/server.py +8481 -8594
  303. package/web/static/img/channel-telegram.svg +1 -1
  304. package/web/static/img/channel-wechat.svg +1 -1
  305. package/web/templates/logs.html +49 -49
  306. package/web/templates/models.html +46 -46
@@ -1,1002 +1,1002 @@
1
- # Shared Technical Standards
2
-
3
- Common technical constraints for PPT Master, eliminating cross-role file duplication.
4
-
5
- ---
6
-
7
- ## 1. SVG Banned Features Blacklist
8
-
9
- The following are **forbidden** in generated SVGs — PPT export breaks otherwise:
10
-
11
- ### 1.0 Text characters: must be well-formed XML
12
-
13
- SVG is strict XML. Two rules for all text and attribute values:
14
-
15
- | Character category | Required form | Forbidden form |
16
- |---|---|---|
17
- | Typography & symbols (em dash, en dash, ©, ®, →, ·, NBSP, full-width punctuation, emoji…) | **Raw Unicode characters** — write `—` `–` `©` `®` `→` directly | HTML named entities — `—` `–` `©` `®` `→` `·` ` ` `…` `•` etc. |
18
- | XML reserved characters (`&`, `<`, `>`, `"`, `'`) | **XML entities only** — `&amp;` `&lt;` `&gt;` `&quot;` `&apos;` (e.g. `R&amp;D`, `error &lt; 5%`) | Bare `&` `<` `>` (e.g. `R&D`, `error < 5%`) |
19
-
20
- One offending character invalidates the file and aborts export. Numeric refs (`&#160;` / `&#xa0;`) are XML-legal but discouraged.
21
-
22
- **Structural blacklist** (in addition to the character rules above):
23
-
24
- | Banned Feature | Description |
25
- |----------------|-------------|
26
- | `mask` | Masks |
27
- | `<style>` | Embedded stylesheets |
28
- | `class` | CSS selector attributes (`id` inside `<defs>` is a legitimate reference and is NOT banned) |
29
- | External CSS | External stylesheet links |
30
- | `<foreignObject>` | Embedded external content |
31
- | `<symbol>` + `<use>` | Symbol reference reuse |
32
- | `textPath` | Text along a path |
33
- | `@font-face` | Custom font declarations |
34
- | `<animate*>` / `<set>` | SVG animations |
35
- | `<script>` / event attributes | Scripts and interactivity |
36
- | `<iframe>` | Embedded frames |
37
-
38
- > **`marker-start` / `marker-end` is conditionally allowed** — see §1.1 for constraints. The converter maps qualifying markers to native DrawingML `<a:headEnd>` / `<a:tailEnd>`.
39
- >
40
- > **`clipPath` on `<image>` is conditionally allowed** — see §1.2 for constraints. The converter maps qualifying clip shapes to native DrawingML picture geometry (`<a:prstGeom>` or `<a:custGeom>`).
41
- >
42
- > **`<pattern>` fills are conditionally allowed** — see §7 *Pattern Fill* for the required `data-pptx-pattern` annotation and the closed OOXML preset enum. Hand-drawn pattern geometry is NOT honored; the converter emits the named PPTX preset only. Missing or invalid preset values produce diagonal stripes (warning) or schema-failed PPTX (error).
43
- >
44
- > **Replacing `<mask>` effects** — DrawingML has no per-pixel alpha. Route by effect:
45
- > - Image gradient overlay (vignette/fade/tint) → stacked `<rect>` with `<linearGradient>`/`<radialGradient>` (§6 Image Overlay)
46
- > - Non-rectangular image crop (circle/rounded/hexagon) → `clipPath` on `<image>` (§1.2)
47
- > - Inner glow / soft-edge → `<filter>` with `<feGaussianBlur>` (§6 Glow)
48
- > - Drop shadow → filter shadow or layered rect (§6 Shadow)
49
- >
50
- > Pixel-level alpha effects (text-knockout image fills, arbitrary alpha composites) have no PPT path — bake into the source image at Image_Generator stage.
51
-
52
- ---
53
-
54
- ### 1.1 Line-end Markers (Conditionally Allowed)
55
-
56
- `marker-start` and `marker-end` on `<line>` and `<path>` elements are allowed **only** when the referenced `<marker>` satisfies all of the following:
57
-
58
- | Requirement | Reason |
59
- |-------------|--------|
60
- | Marker `<marker>` element defined inside `<defs>` | Converter looks up marker defs via id index |
61
- | `orient="auto"` | DrawingML arrow auto-rotates along the line tangent; other orient values will not round-trip |
62
- | Marker shape is **one of**: closed 3-vertex path/polygon (triangle), closed 4-vertex path/polygon (diamond), `<circle>` / `<ellipse>` (oval) | These three map cleanly to DrawingML `type="triangle" / "diamond" / "oval"`. Any other shape is silently dropped with a warning. |
63
- | Marker child's `fill` **matches** the parent line's `stroke` color | In DrawingML the arrow head inherits the line color — a mismatched marker fill will look wrong on export. |
64
- | `markerWidth` / `markerHeight` roughly in `3–15` range | Mapped to `sm` (<6) / `med` (6–12) / `lg` (>12) size buckets. |
65
-
66
- **Use boundary**:
67
-
68
- - `marker-start` / `marker-end`: only for connector arrows where the line is primary
69
- - For block / chunky / solid arrows (arrow body is the visual object), use standalone closed `<path>` / `<polygon>`; see `templates/charts/chevron_process.svg` or `templates/charts/process_flow.svg`
70
-
71
- **Supported DrawingML mapping**:
72
-
73
- | SVG Marker Shape | DrawingML Output |
74
- |------------------|------------------|
75
- | `<path d="M0,0 L10,5 L0,10 Z"/>` (triangle) | `<a:tailEnd type="triangle" w="med" len="med"/>` |
76
- | `<polygon points="0,0 10,5 0,10"/>` | `<a:tailEnd type="triangle" w="med" len="med"/>` |
77
- | 4-vertex closed path/polygon | `<a:tailEnd type="diamond" .../>` |
78
- | `<circle cx="5" cy="5" r="4"/>` | `<a:tailEnd type="oval" .../>` |
79
-
80
- **Recommended template** — a standard arrow-head definition ready to reuse:
81
-
82
- ```xml
83
- <defs>
84
- <marker id="arrowHead" markerWidth="10" markerHeight="10" refX="9" refY="5"
85
- orient="auto" markerUnits="strokeWidth">
86
- <path d="M0,0 L10,5 L0,10 Z" fill="#1976D2"/>
87
- </marker>
88
- </defs>
89
- <line x1="100" y1="200" x2="400" y2="200" stroke="#1976D2" stroke-width="3"
90
- marker-end="url(#arrowHead)"/>
91
- ```
92
-
93
- > ⚠️ Unclassifiable marker shapes (curved paths, multi-segment, >4 vertices) are silently dropped — line renders without arrow. Use a manual `<polygon>` for exotic shapes.
94
-
95
- ---
96
-
97
- ### 1.2 Image Clipping (Conditionally Allowed)
98
-
99
- `clip-path` on `<image>` elements is allowed when the referenced `<clipPath>` satisfies the following:
100
-
101
- | Requirement | Reason |
102
- |-------------|--------|
103
- | `<clipPath>` element defined inside `<defs>` | Converter looks up clip defs via id index |
104
- | Contains a **single** shape child | First child is used; multiple children are not composited |
105
- | Shape is one of: `<circle>`, `<ellipse>`, `<rect>` (with rx/ry), `<path>`, `<polygon>` | These map to DrawingML geometry (preset or custom) |
106
- | Used **only on `<image>` elements** | Non-image elements with clip-path are **forbidden** |
107
-
108
- **Use boundary**:
109
-
110
- - Only on `<image>` for non-rectangular crops (circular avatars, rounded frames, hexagons)
111
- - NOT on shapes (`<rect>`/`<circle>`/`<path>`/`<g>`/`<text>`) — draw the target shape directly. A rect clipped to a circle is just a circle.
112
- - PowerPoint's SVG renderer doesn't handle `clipPath`; only the Native PPTX converter does.
113
-
114
- **Supported DrawingML mapping**:
115
-
116
- | SVG Clip Shape | DrawingML Output | Use Case |
117
- |----------------|------------------|----------|
118
- | `<circle>` / `<ellipse>` | `<a:prstGeom prst="ellipse"/>` | Circular avatar, oval frame |
119
- | `<rect rx="..."/>` | `<a:prstGeom prst="roundRect"/>` with adj value | Rounded rectangle photo frame |
120
- | `<path>` / `<polygon>` | `<a:custGeom>` with path commands | Hexagon, diamond, custom shape |
121
-
122
- **Recommended template** — circular image clip:
123
-
124
- ```xml
125
- <defs>
126
- <clipPath id="avatarClip">
127
- <circle cx="200" cy="200" r="100"/>
128
- </clipPath>
129
- </defs>
130
- <image href="../images/photo.jpg" x="100" y="100" width="200" height="200"
131
- clip-path="url(#avatarClip)" preserveAspectRatio="xMidYMid slice"/>
132
- ```
133
-
134
- **Rounded rectangle clip** — for card-style image frames:
135
-
136
- ```xml
137
- <defs>
138
- <clipPath id="cardClip">
139
- <rect x="60" y="120" width="400" height="250" rx="16"/>
140
- </clipPath>
141
- </defs>
142
- <image href="../images/banner.jpg" x="60" y="120" width="400" height="250"
143
- clip-path="url(#cardClip)" preserveAspectRatio="xMidYMid slice"/>
144
- ```
145
-
146
- > ⚠️ `clip-path` on non-image elements is FORBIDDEN — quality checker errors out. Draw target geometry directly.
147
-
148
- ---
149
-
150
- ## 2. PPT Compatibility Alternatives
151
-
152
- | Banned Syntax | Correct Alternative |
153
- |---------------|---------------------|
154
- | `fill="rgba(255,255,255,0.1)"` | `fill="#FFFFFF" fill-opacity="0.1"` |
155
- | `<g opacity="0.2">...</g>` | Set `fill-opacity` / `stroke-opacity` on each child element individually |
156
- | `<image opacity="0.3"/>` | Overlay a `<rect fill="background-color" opacity="0.7"/>` mask layer after the image |
157
-
158
- **Mnemonic**: PPT does not recognize rgba, group opacity, or image opacity.
159
-
160
- > Arrows: prefer `marker-end` for connector lines (§1.1) — converter produces native auto-rotating arrow heads. For block/chunky arrows, use standalone closed shapes; see `templates/charts/chevron_process.svg` and `templates/charts/process_flow.svg`.
161
-
162
- ---
163
-
164
- ## 3. Canvas Format Quick Reference
165
-
166
- > See [`canvas-formats.md`](canvas-formats.md) for the full format table (presentations / social / marketing) and the format-selection decision tree.
167
-
168
- ---
169
-
170
- ## 4. Basic SVG Rules
171
-
172
- - **viewBox** MUST match the canvas dimensions; it is the single source of truth for canvas size. Root `width`/`height` are optional compatibility attributes and are not used as PPT Master canvas authority.
173
- - **Background**: Use `<rect>` to define the page background color
174
- - **`<tspan>`** has two purposes: (1) manual line breaks (use `dy` or explicit `y`); (2) inline run formatting on the same line (color/weight/size). `<foreignObject>` is FORBIDDEN. See "Single logical line" rule below.
175
- - **Fonts**: every `font-family` stack MUST resolve to pre-installed exported Latin / EA typefaces (Microsoft YaHei / SimSun / Arial / Times New Roman / Consolas …); `@font-face` is FORBIDDEN. Full rule: [`strategist.md §g`](strategist.md).
176
- - **Styles**: inline only (`fill=""`, `font-size=""`); `<style>`/`class` FORBIDDEN (`id` inside `<defs>` is fine)
177
- - **Colors**: HEX only; transparency via `fill-opacity`/`stroke-opacity`
178
- - **Images**: `<image href="../images/xxx.png" preserveAspectRatio="xMidYMid slice"/>`
179
- - **Icons**: `<use data-icon="<library>/<name>" x="" y="" width="48" height="48" fill="#HEX"/>` (auto-embedded post-processing). Always include library prefix. One stylistic library per deck (`chunk-filled`/`tabler-filled`/`tabler-outline`/`phosphor-duotone`); `simple-icons` only for real brand marks. See [`../templates/icons/README.md`](../templates/icons/README.md).
180
-
181
- ### Inline Text Runs (Single Logical Line = Single `<text>`)
182
-
183
- One logical line — even with mixed colors/weights/sizes — MUST be one `<text>` with inline `<tspan>` children. Never use multiple adjacent `<text>` elements. The converter maps each `<tspan>` to a `<a:r>` run within the same PPT text frame, keeping the line as one editable shape.
184
-
185
- ✅ **DO** — one `<text>` → one text frame with three runs:
186
-
187
- ```xml
188
- <text x="100" y="200" font-size="24" fill="#333333">
189
- 实现<tspan fill="#1A73E8" font-weight="bold">10倍</tspan>效率提升
190
- </text>
191
- ```
192
-
193
- ❌ **DON'T** — three side-by-side `<text>` elements become three separate text frames in PPT (breaks edit-as-one-line, risks alignment drift, makes spacing fragile):
194
-
195
- ```xml
196
- <text x="100" y="200" font-size="24" fill="#333333">实现</text>
197
- <text x="160" y="200" font-size="24" fill="#1A73E8" font-weight="bold">10倍</text>
198
- <text x="240" y="200" font-size="24" fill="#333333">效率提升</text>
199
- ```
200
-
201
- **⚠️ Inline tspans must NOT carry `x`/`y`/`dy`** — those mark a new line, and `flatten_tspan` will split into a separate text frame. `dx` is safe (kerning, stays inline). Only set `x`/`y`/`dy` on tspans that genuinely start a new line.
202
-
203
- **Multi-line `<text>` with per-line emphasis works**: an outer line-break tspan (with `x` + `dy` or `y`) MAY contain nested inline tspans for color/weight/size — converter walks nested tspans and emits one run per styled segment:
204
-
205
- ```xml
206
- <text x="80" y="190" font-size="18" fill="#333333">
207
- <tspan x="80" dy="0">完成率<tspan fill="#4CAF50" font-weight="bold">98%</tspan>超预期</tspan>
208
- <tspan x="80" dy="35">成本降低<tspan fill="#F44336" font-weight="bold">¥120万</tspan></tspan>
209
- </text>
210
- ```
211
-
212
- ❌ **DON'T** — same-line column jump via `<tspan x="...">`:
213
-
214
- ```xml
215
- <text x="100" y="200" font-size="18" fill="#333333">
216
- <tspan x="100">左列</tspan><tspan x="600" font-weight="bold">右列</tspan>
217
- </text>
218
- ```
219
-
220
- `x` on a tspan starts a new line, splitting into two independent text frames. For two-column layouts, write two `<text>` elements.
221
-
222
- **Default — lift key information.** Uniform-styled paragraphs read as walls of text. Wrap these in `<tspan fill="..." font-weight="bold">`:
223
-
224
- - **Numerical results** — percentages, multipliers (`10x`), absolute amounts (`¥120万`)
225
- - **Contrasts** — gain/loss, before/after, target/actual
226
- - **One or two load-bearing nouns per sentence** — the term that carries the insight
227
-
228
- Do NOT highlight: connectives, common verbs, every noun, decorative adjectives, structural text (footer/axis/legend/page number/labels).
229
-
230
- Color: use the deck's primary brand color for emphasis. Reserve green/red for actual positive/negative semantics.
231
-
232
- ❌ **DON'T** — uniform-styled paragraph buries the insight:
233
-
234
- ```xml
235
- <text x="80" y="200" font-size="20" fill="#333333">
236
- 2024年公司营收同比增长35%达到12亿元创历史新高
237
- </text>
238
- ```
239
-
240
- ✅ **DO** — same line, key data lifted:
241
-
242
- ```xml
243
- <text x="80" y="200" font-size="20" fill="#333333">
244
- 2024年公司营收同比<tspan fill="#1A73E8" font-weight="bold">增长35%</tspan>达到<tspan fill="#1A73E8" font-weight="bold">12亿元</tspan>创历史新高
245
- </text>
246
- ```
247
-
248
- ### Element Grouping (Mandatory)
249
-
250
- Wrap logically related elements in top-level `<g id="...">` groups. Produces PowerPoint groups in PPTX, making slides easier to select/move/edit and providing stable anchors for optional per-element entrance animation.
251
-
252
- > ⚠️ Only `<g opacity="...">` is banned (§2). Plain `<g>` for grouping is required.
253
-
254
- **Animation-ready rule**: direct children of `<svg>` should be semantic groups, not raw drawing atoms. Aim for **3–8 top-level content `<g id>` groups per slide** (the 3–8 budget excludes page chrome — see below); each content group becomes one entrance step under the chosen `--animation-trigger` mode (one click in `on-click`, one cascade slot in `after-previous`, parallel in `with-previous`).
255
-
256
- **Chrome groups are excluded automatically.** The exporter treats top-level groups whose id contains chrome tokens as page chrome and skips them in the animation sequence — they appear together with the slide. Tokens (matched against id after splitting on `-` / `_`): `background`, `bg`, `decoration` / `decorations` / `decor`, `header`, `footer`, `chrome`, `watermark`, `pagenumber` / `pagenum` / `page-number`, `nav`, `logo`, `rule`. So `<g id="bg-texture">`, `<g id="cover-footer">`, `<g id="p03-header">`, `<g id="bottom-decor">`, `<g id="nav">`, `<g id="logo-area">`, `<g id="column-rule">` all skip animation while keeping their `<g>` wrapper for editing/grouping. Use these naming conventions for chrome — do **not** strip the `<g>` wrapper.
257
-
258
- **What to group**:
259
-
260
- | Grouping Unit | Contains |
261
- |---------------|----------|
262
- | Card / panel | Background rect + (optional shadow only if the card floats over a photo/colored panel — see §6) + icon + title + body text |
263
- | Process step | Number circle + icon + label + description |
264
- | List item | Bullet / number + icon + title + description |
265
- | Icon-text combo | Icon element + adjacent label |
266
- | Page header | Title + subtitle + accent decoration |
267
- | Page footer | Page number + branding |
268
- | Decorative cluster | Related decorative shapes (rings, orbs, dots) |
269
-
270
- **Do not**:
271
-
272
- - Put the whole slide into one giant `<g>`; that leaves only one animation step.
273
- - Leave many top-level `<rect>` / `<text>` / `<path>` elements ungrouped; fallback animation is capped at 8 primitives and dense flat pages may skip animation.
274
- - Split every icon, text line, or decorative mark into separate top-level groups; that creates too many click steps.
275
- - Use anonymous top-level groups. Every top-level semantic group needs a descriptive `id`.
276
-
277
- **Example**:
278
-
279
- ```xml
280
- <g id="card-benefits-1">
281
- <!-- This card floats over a colored panel — shadow is appropriate. On a flat white canvas, omit the filter. -->
282
- <rect x="60" y="115" width="565" height="260" rx="20" fill="#FFFFFF" filter="url(#shadow)"/>
283
- <use data-icon="chunk-filled/bolt" x="108" y="163" width="44" height="44" fill="#0071E3"/>
284
- <text x="105" y="270" font-size="56" font-weight="bold" fill="#0071E3">10×</text>
285
- <text x="250" y="270" font-size="30" font-weight="bold" fill="#1D1D1F">Faster</text>
286
- <text x="105" y="310" font-size="18" fill="#6E6E73">Reduce production time from days to hours.</text>
287
- </g>
288
- ```
289
-
290
- **Naming**: descriptive `id` on top-level `<g>` is **required** (e.g., `card-1`, `step-discover`, `header`, `footer`). Each top-level `<g id>` becomes one anchor for per-element entrance animation in PPTX export; without it, the exporter falls back to at most 8 top-level primitives or skips animation on dense pages.
291
-
292
- ---
293
-
294
- ## 5. Post-processing Pipeline (3 Steps)
295
-
296
- Must be executed in order — skipping or adding extra flags is FORBIDDEN:
297
-
298
- ```bash
299
- # 1. Split speaker notes into per-page note files
300
- python3 scripts/total_md_split.py <project_path>
301
-
302
- # 2. SVG post-processing (icon embedding, image crop/embed/optimization, text flattening, rounded rect to path)
303
- python3 scripts/finalize_svg.py <project_path>
304
-
305
- # 3. Export PPTX (embeds speaker notes by default)
306
- python3 scripts/svg_to_pptx.py <project_path>
307
- # Output (default-flow mode):
308
- # exports/<project_name>_<timestamp>.pptx ← native pptx (canonical output)
309
- # backup/<timestamp>/svg_output/ ← Executor SVG source backup (always written)
310
- #
311
- # Add --svg-snapshot to additionally emit:
312
- # exports/<project_name>_<timestamp>_svg.pptx ← SVG snapshot pptx (sibling of native pptx)
313
- ```
314
-
315
- **Optional animation flags** (only when the user asks):
316
- - `-t <effect>` — page transition (`fade` / `push` / `wipe` / `split` / `strips` / `cover` / `random` / `none`; default `fade`)
317
- - `-a <effect>` — per-element entrance animation (`fade` / `auto` / `mixed` / `random` / one of 22 named effects / `none`; **default `none`** — pages appear as a whole, no auto element builds; opt in with `auto`, which maps effect from group id — image-like ids cycle zoom/dissolve/circle/box/diamond/wheel, other matches map to a single effect, unmatched ids cycle fade/wipe/fly/zoom). Anchors on top-level `<g id="...">` groups.
318
- - `--animation-trigger {on-click,with-previous,after-previous}` — Start mode matching PowerPoint's animation-pane Start dropdown. Default `after-previous` (cascade on slide entry; pace via `--animation-stagger <seconds>`); `on-click` advances per click; `with-previous` plays all groups together.
319
- - `--animation-config <path>` — optional object-level animation sidecar. Default: `<project>/animations.json` when present.
320
- - `--auto-advance <seconds>` — kiosk-style auto-play
321
-
322
- **Optional recorded narration** (only when the user asks for narrated/video export):
323
-
324
- ```bash
325
- python3 scripts/notes_to_audio.py <project_path> --voice zh-CN-XiaoxiaoNeural
326
- python3 scripts/svg_to_pptx.py <project_path> --recorded-narration audio
327
- ```
328
-
329
- - `notes_to_audio.py` reads split `notes/*.md` files and writes one audio file per slide to `audio/`. Default `edge` output is MP3; configured cloud providers may output MP3 or WAV depending on provider settings.
330
- - `--recorded-narration audio` prepares PowerPoint's recorded timings and narrations: every slide needs matching `m4a` / `mp3` / `wav` audio, every duration must be readable by `ffprobe`, and `on-click` object animation is rejected.
331
- - `--recorded-narration audio` embeds matching audio, keeps speaker notes, and sets slide timings from audio duration.
332
- - `--narration-audio-dir audio` is the lower-level embedding path for partial audio coverage; it does not prepare a complete recorded-timings export.
333
- - Long-audio import and automatic long-audio splitting are not supported.
334
-
335
- Full reference: [`animations.md`](animations.md).
336
-
337
- **Prohibited**:
338
- - NEVER use `cp` as a substitute for `finalize_svg.py`
339
- - NEVER force `-s output` for the legacy/preview pptx (PowerPoint's internal SVG parser drops icons and rounded corners). Default auto-split already gives native the high-fidelity source it needs without affecting legacy.
340
- - NEVER use `--only` (it suppresses one of the two output files)
341
-
342
- > Source-directory split: by default `svg_to_pptx.py` reads `svg_output/` for the native pptx (preserves icon `<use>`, image `preserveAspectRatio` as native picture-crop metadata, rounded rect `rx/ry` → `prstGeom roundRect`) and `svg_final/` for the legacy/preview pptx (PowerPoint's internal SVG parser needs the flattened form). Pass `-s output` or `-s final` only when you specifically want both products to read from a single source.
343
-
344
- **Default — raster size control**: `finalize_svg.py` optimizes raster images using a rendered-size budget of `2x` display pixels with a `2560px` maximum dimension; it may crop pixels for the flattened SVG snapshot. Native `svg_to_pptx.py` defaults to `--image-sizing cap`: it downscales only oversized full source images to `--image-max-dimension 2560`, keeps display cropping as editable PPT picture-crop metadata, and does not shrink a picture merely because its current SVG placement is small. Opaque PNG photos may become JPEG; transparent assets remain PNG. Use `finalize_svg.py --no-compress` / a higher `--max-dimension` only for diagnostic SVG snapshots, `svg_to_pptx.py --no-image-optimize` only when the native PPTX must retain original image bytes, and `svg_to_pptx.py --image-sizing display --image-scale 2` only for aggressive size reduction.
345
-
346
- **Re-run rule**: Any change to `svg_output/` after post-processing requires re-running Steps 2-3. Step 1 only re-runs if `notes/total.md` changed.
347
-
348
- ---
349
-
350
- ## 6. Shadow & Overlay Techniques
351
-
352
- > `<mask>` elements and `<image opacity="...">` are banned. Always use stacked `<rect>` or gradient overlays instead (see §2).
353
-
354
- ### Shadow
355
-
356
- > **Shadow is restraint, not default.** The "designed" feel comes from absence, not abundance.
357
-
358
- #### When to use
359
-
360
- Only when the element genuinely floats above another layer:
361
- - Card / quote bubble / annotation on a photo or colored panel
362
- - Single primary CTA or "recommended" item picked out from peers
363
- - Overlay layer (callout, tooltip, modal emphasis)
364
- - Floating image card on a textured background
365
-
366
- #### When NOT to use
367
-
368
- - Background panels / dividers / decorative bars — they are the floor
369
- - Equal peer cards in a 2/3/4-up grid — keep all flat
370
- - Containers with visible border, gradient fill, or strong tint — redundant
371
- - Body-text paragraph containers — disrupts scan rhythm
372
- - Decorative lines / dividers / icons — they are symbols, not objects
373
- - Pages with only one content container — no second layer to lift above
374
- - Dark backgrounds — black shadows vanish; use 1px low-opacity white stroke or outer glow
375
-
376
- **Reference — not a constraint**: 2-3 shadowed elements per page usually reads cleanest; before adding a 4th, check the extra layering earns its weight — a genuinely complex dashboard may justify more.
377
-
378
- #### Single light source per page
379
-
380
- All `feOffset` on a page must share the same `dx`/`dy` direction. Default: `dx="0"`, `dy="4"`-`dy="8"` (light from upper front).
381
-
382
- #### Restraint over visibility
383
-
384
- Standard: "the shadow is felt, not seen." If noticed, it's too strong.
385
- - Resting cards: `flood-opacity` 0.06-0.10
386
- - Raised elements (CTA, overlay): max `flood-opacity` 0.20
387
- - Above 0.20 = Office 2007 hard-shadow look
388
- - Color: near-black at low opacity, or a darker tint of background. Brand-color shadow only on accent elements sharing that hue.
389
-
390
- #### Two-tier elevation maximum
391
-
392
- A page may have at most two non-floor tiers.
393
-
394
- | Tier | When | dy | stdDeviation | flood-opacity |
395
- |------|------|----|--------------|---------------|
396
- | Floor (no shadow) | Backgrounds, peer-grid cards, dividers, body-text containers | — | — | — |
397
- | Resting | Cards on photos/panels, secondary callouts | 2-4 | 4-8 | 0.06-0.10 |
398
- | Raised | Primary CTA, focused/recommended card, overlay | 6-10 | 10-16 | 0.12-0.20 |
399
-
400
- #### Don't stack visual-weight tools
401
-
402
- Pick **one** per container: shadow, border, gradient fill, or strong tint. Stacking = instant template look.
403
-
404
- ---
405
-
406
- #### Filter Soft Shadow — Recommended
407
-
408
- Best for: cards, floating panels, elevated elements. The `svg_to_pptx` converter automatically converts `feGaussianBlur` + `feOffset` into native PPTX `<a:outerShdw>`.
409
-
410
- ```xml
411
- <defs>
412
- <filter id="softShadow" x="-15%" y="-15%" width="140%" height="140%">
413
- <feGaussianBlur in="SourceAlpha" stdDeviation="12"/>
414
- <feOffset dx="0" dy="6" result="offsetBlur"/>
415
- <feFlood flood-color="#000000" flood-opacity="0.10" result="shadowColor"/>
416
- <feComposite in="shadowColor" in2="offsetBlur" operator="in" result="shadow"/>
417
- <feMerge>
418
- <feMergeNode in="shadow"/>
419
- <feMergeNode in="SourceGraphic"/>
420
- </feMerge>
421
- </filter>
422
- </defs>
423
- <rect x="60" y="60" width="400" height="240" rx="12" fill="#FFFFFF" filter="url(#softShadow)"/>
424
- ```
425
-
426
- Recommended parameters (see "Two-tier elevation maximum" above for tier guidance):
427
- ```
428
- stdDeviation: 4–16 (resting cards: 4–8; raised elements: 10–16)
429
- flood-opacity: 0.06–0.10 (resting cards — default)
430
- 0.12–0.20 (raised elements only — primary CTA, overlay)
431
- NEVER > 0.20 (Office 2007 hard-shadow look)
432
- dy: 2–10 (resting: 2–4; raised: 6–10)
433
- dx: 0–2 (must match every other shadow on the page — single light source)
434
- ```
435
-
436
- #### Colored Shadow
437
-
438
- Best for: accent buttons, brand-colored cards. Use the element's own color family instead of black.
439
-
440
- ```xml
441
- <filter id="colorShadow" x="-15%" y="-15%" width="140%" height="140%">
442
- <feGaussianBlur in="SourceAlpha" stdDeviation="10"/>
443
- <feOffset dx="0" dy="6" result="offsetBlur"/>
444
- <feFlood flood-color="#1A73E8" flood-opacity="0.20" result="shadowColor"/>
445
- <feComposite in="shadowColor" in2="offsetBlur" operator="in" result="shadow"/>
446
- <feMerge>
447
- <feMergeNode in="shadow"/>
448
- <feMergeNode in="SourceGraphic"/>
449
- </feMerge>
450
- </filter>
451
- ```
452
-
453
- Replace `flood-color` with the element's brand color. Keep `flood-opacity` 0.12-0.20. Reserve for the single primary CTA per page — using on every button defeats the cue.
454
-
455
- #### Glow Effect
456
-
457
- Best for: title highlights, key metrics, hero text. The converter automatically converts `feGaussianBlur` without `feOffset` into native PPTX `<a:glow>`.
458
-
459
- ```xml
460
- <defs>
461
- <filter id="titleGlow" x="-30%" y="-30%" width="160%" height="160%">
462
- <feGaussianBlur in="SourceAlpha" stdDeviation="6" result="blur"/>
463
- <feFlood flood-color="#1A73E8" flood-opacity="0.45" result="glowColor"/>
464
- <feComposite in="glowColor" in2="blur" operator="in" result="glow"/>
465
- <feMerge>
466
- <feMergeNode in="glow"/>
467
- <feMergeNode in="SourceGraphic"/>
468
- </feMerge>
469
- </filter>
470
- </defs>
471
- <text x="640" y="360" text-anchor="middle" font-size="48" fill="#1A73E8" filter="url(#titleGlow)">Key Insight</text>
472
- ```
473
-
474
- Recommended parameters:
475
- ```
476
- stdDeviation: 4–8 (smaller = subtle, larger = prominent)
477
- flood-color: brand color or accent color (NOT black)
478
- flood-opacity: 0.35–0.55 (stronger than shadow for visibility)
479
- ```
480
-
481
- **vs shadow**: no `<feOffset>` (or dx=0/dy=0). The converter uses this to distinguish glow from shadow.
482
-
483
- #### Layered Rect Shadow — High-Compatibility Fallback
484
-
485
- Best for: maximum compatibility with older PowerPoint versions. Stack 2–3 semi-transparent rectangles behind the main card:
486
-
487
- ```xml
488
- <!-- Shadow layers (back to front, largest offset first) -->
489
- <rect x="68" y="72" width="400" height="240" rx="16" fill="#000000" fill-opacity="0.03"/>
490
- <rect x="65" y="69" width="400" height="240" rx="14" fill="#000000" fill-opacity="0.05"/>
491
- <rect x="62" y="66" width="400" height="240" rx="12" fill="#1A73E8" fill-opacity="0.04"/>
492
- <!-- Main card -->
493
- <rect x="60" y="60" width="400" height="240" rx="12" fill="#FFFFFF"/>
494
- ```
495
-
496
- ### Image Overlay
497
-
498
- #### Linear Gradient Overlay — Most Common
499
-
500
- Best for: image+text pages. Gradient direction should match text position (text on left → gradient darkens toward left).
501
-
502
- ```xml
503
- <image href="..." x="0" y="0" width="1280" height="720" preserveAspectRatio="xMidYMid slice"/>
504
- <defs>
505
- <linearGradient id="imgOverlay" x1="0" y1="0" x2="1" y2="0">
506
- <stop offset="0%" stop-color="#1A1A2E" stop-opacity="0.85"/>
507
- <stop offset="55%" stop-color="#1A1A2E" stop-opacity="0.30"/>
508
- <stop offset="100%" stop-color="#1A1A2E" stop-opacity="0"/>
509
- </linearGradient>
510
- </defs>
511
- <rect x="0" y="0" width="1280" height="720" fill="url(#imgOverlay)"/>
512
- ```
513
-
514
- #### Bottom Gradient Bar
515
-
516
- Best for: cover slides and full-image pages with bottom title.
517
-
518
- ```xml
519
- <defs>
520
- <linearGradient id="bottomBar" x1="0" y1="0" x2="0" y2="1">
521
- <stop offset="0%" stop-color="#000000" stop-opacity="0"/>
522
- <stop offset="100%" stop-color="#000000" stop-opacity="0.72"/>
523
- </linearGradient>
524
- </defs>
525
- <rect x="0" y="380" width="1280" height="340" fill="url(#bottomBar)"/>
526
- ```
527
-
528
- #### Radial Gradient Overlay — Vignette Effect
529
-
530
- Best for: full-screen atmosphere slides; draws attention to the center.
531
-
532
- ```xml
533
- <defs>
534
- <radialGradient id="vignette" cx="50%" cy="50%" r="70%">
535
- <stop offset="0%" stop-color="#000000" stop-opacity="0"/>
536
- <stop offset="100%" stop-color="#000000" stop-opacity="0.58"/>
537
- </radialGradient>
538
- </defs>
539
- <rect x="0" y="0" width="1280" height="720" fill="url(#vignette)"/>
540
- ```
541
-
542
- #### Brand Color Overlay
543
-
544
- Best for: slides needing strong visual brand identity.
545
-
546
- ```xml
547
- <defs>
548
- <linearGradient id="brandOverlay" x1="0" y1="0" x2="1" y2="0">
549
- <stop offset="0%" stop-color="#005587" stop-opacity="0.80"/>
550
- <stop offset="100%" stop-color="#005587" stop-opacity="0.10"/>
551
- </linearGradient>
552
- </defs>
553
- <rect x="0" y="0" width="1280" height="720" fill="url(#brandOverlay)"/>
554
- ```
555
-
556
- ### Quick-Reference Table
557
-
558
- | Scenario | Recommended Technique | Avoid |
559
- |----------|-----------------------|-------|
560
- | Card / panel shadow (only when floating over photo/colored panel) | Filter soft shadow (`flood-opacity` 0.06–0.10, single light source) | Hard black shadow, full-page abundance |
561
- | Equal peer cards in a grid | All flat (no shadow) | Lifting every card uniformly |
562
- | Page-section background panel | Flat fill, no shadow | Treating panels as floating cards |
563
- | Accent / CTA button (one per page) | Colored shadow (same hue family, `flood-opacity` 0.12–0.20) | Generic gray shadow, applying to every button |
564
- | Title / metric highlight | Glow filter (brand color, no offset) | Overuse on body text |
565
- | Text over image | Linear gradient overlay (direction matches text side) | Uniform flat opacity over whole image |
566
- | Cover / full-image slide | Bottom gradient bar + brand color | Solid black overlay |
567
- | Atmosphere / hero slide | Radial vignette | Unprocessed raw image |
568
- | Max PPT compatibility needed | Layered rect shadow | Filter-based shadow |
569
-
570
- ---
571
-
572
- ## 7. Stroke, Text & Shape Effects
573
-
574
- ### stroke-dasharray — Dashed / Dotted Lines
575
-
576
- Converts to native PPTX `<a:prstDash>`. Use preset patterns for best results:
577
-
578
- | SVG Value | PPTX Preset | Best For |
579
- |-----------|-------------|----------|
580
- | `4,4` | Dash | General dashed lines, separators |
581
- | `2,2` | Dot (sysDot) | Subtle dotted borders, placeholder outlines |
582
- | `8,4` | Long dash | Timeline connectors, flow arrows |
583
- | `8,4,2,4` | Long dash-dot | Technical drawings, dimension lines |
584
-
585
- ```xml
586
- <rect x="60" y="60" width="400" height="240" rx="12"
587
- fill="none" stroke="#999999" stroke-width="2" stroke-dasharray="4,4"/>
588
-
589
- <line x1="100" y1="360" x2="1180" y2="360"
590
- stroke="#CCCCCC" stroke-width="1" stroke-dasharray="2,2"/>
591
- ```
592
-
593
- ### stroke-linejoin
594
-
595
- Controls how line segments join at corners. Supported values convert to native PPTX line join types:
596
-
597
- | SVG Value | PPTX Equivalent | Best For |
598
- |-----------|-----------------|----------|
599
- | `round` | Round join | Smooth polyline charts, organic shapes |
600
- | `bevel` | Bevel join | Technical diagrams |
601
- | `miter` | Miter join (default) | Sharp-cornered rectangles, arrows |
602
-
603
- ```xml
604
- <polyline points="100,200 200,100 300,200" fill="none"
605
- stroke="#1A73E8" stroke-width="3" stroke-linejoin="round"/>
606
- ```
607
-
608
- ### text-decoration
609
-
610
- Supported text decorations convert to native PPTX text formatting:
611
-
612
- | SVG Value | PPTX Equivalent | Best For |
613
- |-----------|-----------------|----------|
614
- | `underline` | Single underline | Emphasis, links, key terms |
615
- | `line-through` | Strikethrough | Removed items, before/after comparisons |
616
-
617
- ```xml
618
- <text x="100" y="200" font-size="20" fill="#333333" text-decoration="underline">Important Term</text>
619
-
620
- <!-- Per-tspan decoration -->
621
- <text x="100" y="240" font-size="18" fill="#333333">
622
- Regular text <tspan text-decoration="line-through" fill="#999999">old value</tspan> new value
623
- </text>
624
- ```
625
-
626
- ### Gradient Fill — linearGradient & radialGradient
627
-
628
- Gradients defined in `<defs>` and referenced via `fill="url(#id)"` convert to native PPTX `<a:gradFill>`. Use them as shape fills (not just overlays) for polished surfaces.
629
-
630
- **Linear gradient** — best for buttons, header bars, background panels:
631
-
632
- ```xml
633
- <defs>
634
- <linearGradient id="btnGrad" x1="0" y1="0" x2="1" y2="0">
635
- <stop offset="0%" stop-color="#1A73E8"/>
636
- <stop offset="100%" stop-color="#0D47A1"/>
637
- </linearGradient>
638
- </defs>
639
- <rect x="540" y="600" width="200" height="48" rx="24" fill="url(#btnGrad)"/>
640
- ```
641
-
642
- **Radial gradient** — best for spotlight backgrounds, circular accents:
643
-
644
- ```xml
645
- <defs>
646
- <radialGradient id="spotBg" cx="50%" cy="50%" r="70%">
647
- <stop offset="0%" stop-color="#1A73E8" stop-opacity="0.15"/>
648
- <stop offset="100%" stop-color="#1A73E8" stop-opacity="0"/>
649
- </radialGradient>
650
- </defs>
651
- <circle cx="640" cy="360" r="300" fill="url(#spotBg)"/>
652
- ```
653
-
654
- ### Pattern Fill — `<pattern>` with PPTX preset annotation
655
-
656
- `<pattern>` fills convert to native PPTX `<a:pattFill prst="...">` — but only PPTX's built-in preset patterns are reachable. The converter does **not** render hand-drawn `<path>` geometry inside the pattern; instead it reads two annotations off the `<pattern>` element and emits the matching DrawingML preset.
657
-
658
- **Prefer explicit geometry when spacing matters.** A `<pattern>` renders at PowerPoint's **fixed preset density** — you cannot reproduce a specific tile size (e.g. a 40px grid). For grids / textures whose spacing or line weight is part of the design, draw the lines as **one `<path>` with all lines as subpaths** (`M40 0V720 M80 0V720 … M0 40H1280 …`, `fill="none" stroke=…`) — the converter supports `M/L/H/V` and multi-subpath, so it becomes **one editable vector shape that reproduces the exact spacing** across all four renderers. Reserve `<pattern>` + `data-pptx-pattern` for **round-tripping an existing PPTX** (decks imported via `pptx_to_svg`), where the source genuinely used a native preset fill. For pure display where no PPT-side editing is needed, `--svg-snapshot` is the other faithful option.
659
-
660
- **Required annotations** (only when you intentionally use a `<pattern>` preset):
661
-
662
- | Attribute | Purpose | Without it |
663
- |---|---|---|
664
- | `data-pptx-pattern="<preset>"` | Names the PPTX preset (one of the enum below) | Falls back to `ltUpDiag` — diagonal stripes, not your geometry |
665
- | Child `<rect fill="<bg-hex>"/>` | Background color of the pattern tile | `bg` falls back to `#FFFFFF`, painting over the page background |
666
-
667
- The child `<path>`'s `stroke` becomes the foreground color (the pattern's line color).
668
-
669
- ```xml
670
- <defs>
671
- <pattern id="bpGrid" x="0" y="0" width="40" height="40"
672
- patternUnits="userSpaceOnUse" data-pptx-pattern="lgGrid">
673
- <rect width="40" height="40" fill="#0E2A47"/>
674
- <path d="M 40 0 L 0 0 0 40" fill="none" stroke="#2D4A6B" stroke-width="0.6"/>
675
- </pattern>
676
- </defs>
677
- <rect width="1280" height="720" fill="url(#bpGrid)"/>
678
- ```
679
-
680
- **Valid `data-pptx-pattern` values** (OOXML `ST_PresetPatternVal` — closed enum, anything outside makes PowerPoint open with "needs to be repaired"):
681
-
682
- | Category | Values |
683
- |---|---|
684
- | Grids | `smGrid` · `lgGrid` · `dotGrid` *(no `ltGrid` — common typo)* |
685
- | Diagonal lines | `ltUpDiag` · `ltDnDiag` · `dkUpDiag` · `dkDnDiag` · `wdUpDiag` · `wdDnDiag` · `dashUpDiag` · `dashDnDiag` · `diagCross` |
686
- | Horizontal / vertical lines | `horz` · `vert` · `ltHorz` · `ltVert` · `dkHorz` · `dkVert` · `narHorz` · `narVert` · `dashHorz` · `dashVert` · `cross` |
687
- | Percent fills | `pct5` · `pct10` · `pct20` · `pct25` · `pct30` · `pct40` · `pct50` · `pct60` · `pct70` · `pct75` · `pct80` · `pct90` |
688
- | Checks & confetti | `smCheck` · `lgCheck` · `smConfetti` · `lgConfetti` |
689
- | Decorative | `horzBrick` · `diagBrick` · `weave` · `plaid` · `trellis` · `zigZag` · `wave` · `sphere` · `divot` · `shingle` · `solidDmnd` · `openDmnd` · `dotDmnd` |
690
-
691
- > `svg_quality_checker.py` warns on missing `data-pptx-pattern` and errors on values outside the enum. Catch these pre-export — PowerPoint's repair dialog hides which pattern broke.
692
-
693
- ### Native PPTX Table / Chart Markers (Experimental)
694
-
695
- Native PowerPoint tables and Excel-backed charts activate at export time only. The default chart/table route remains hand-authored SVG geometry so the deck stays pixel-stable across PowerPoint / Keynote / LibreOffice / WPS.
696
-
697
- **Authoring — markers are standard on supported data charts and text-grid tables**: Executor writes the marker at draw time on every data chart whose type falls in the supported set and on every pure text-grid data table ([executor-base.md §3.2](executor-base.md)), so any deck can later form native objects without regeneration. Tables with merged or graphical cells stay unmarked on the SVG fallback route. The marker group supplies both: visible SVG fallback children for browser/live-preview rendering, and JSON metadata for `svg_to_pptx` native export.
698
-
699
- **Hard rule — activation is the opt-in, dormant unless exported with `--native-objects`**: A marker only declares that a group is eligible for native export. Normal `svg_to_pptx.py` runs keep the fallback SVG children. Pass `--native-objects` only when editability in PowerPoint matters more than cross-renderer layout fidelity: it emits the PowerPoint object and skips the fallback children to avoid duplicates. Native styling preserves the core palette, text, axis, grid, and background colors where possible, but it is still a PowerPoint chart/table object rather than a pixel-identical SVG drawing.
700
-
701
- | Marker | Native output | Required metadata |
702
- |---|---|---|
703
- | `<g data-pptx-native="table">` | `<p:graphicFrame>` with `<a:tbl>` | bounds + `columns` or `rows` |
704
- | `<g data-pptx-native="chart">` | `<p:graphicFrame>` with `c:chart` / `cx:chart` + chart part + embedded workbook | bounds + `type`, plus chart data |
705
-
706
- **Metadata placement**: Put JSON in a child `<metadata data-pptx-native="...">`. Attribute JSON (`data-pptx-json="..."`) is supported but harder to XML-escape correctly.
707
-
708
- **Bounds**: Provide `x`, `y`, `width`, and `height` in metadata, or as
709
- `data-pptx-x` / `data-pptx-y` / `data-pptx-width` / `data-pptx-height` on the
710
- marker group. If any bound is omitted, the exporter infers the object frame
711
- from the visible fallback geometry; this keeps SVG fallback and native object
712
- placement aligned.
713
-
714
- **Validation**: `svg_quality_checker.py` validates native marker kind, JSON
715
- metadata, bounds/fallback availability, table rows/columns, supported chart
716
- type, and chart data shape before export.
717
-
718
- ```xml
719
- <g id="p03-revenue-chart" data-pptx-native="chart">
720
- <metadata data-pptx-native="chart">
721
- {
722
- "x": 120, "y": 150, "width": 520, "height": 320,
723
- "type": "column",
724
- "title": "Revenue by Segment",
725
- "categories": ["Q1", "Q2", "Q3"],
726
- "series": [
727
- {"name": "Cloud", "values": [12, 15, 19]},
728
- {"name": "Services", "values": [8, 9, 11]}
729
- ]
730
- }
731
- </metadata>
732
- <!-- Visible SVG fallback for live preview / non-native export goes here. -->
733
- </g>
734
- ```
735
-
736
- **Table schema**: Native tables are rectangular DrawingML grids. Use `columns`
737
- for the optional header row and `rows` for body rows; shorter rows are padded
738
- with blank cells unless `strict_grid: true` is set. Use `column_widths` and
739
- `row_heights` as relative weights. Cell objects accept `text`, `fill`, `color`,
740
- `align`, `valign`, `bold`, `font_size`, `padding`, `border_color`, and
741
- `border_width`; the same `padding`, `border_color`, and `border_width` keys may
742
- also live under `style` as table defaults. Native table typography mirrors the
743
- visible SVG fallback: put `style.font_family` and `style.font_size` on the
744
- marker from the table text already drawn, then use `style.header_font_size` or
745
- per-cell `font_size` only when the fallback visibly differs. If the fallback
746
- has no explicit table font, use the deck body family and locked body size from
747
- `spec_lock.md`.
748
-
749
- **Hard rule — table metadata is the native source of truth**: Every row,
750
- summary line, value, and cell-level style that must survive
751
- `--native-objects` must be present in `columns` / `rows`. SVG fallback text is
752
- discarded during native export. `svg_quality_checker.py` warns when visible
753
- fallback `<text>` inside a native table marker does not appear in metadata.
754
- For numeric or currency columns, use cell objects with `align: "r"`; SVG
755
- `text-anchor="end"` does not carry into the native table.
756
-
757
- **Forbidden — native merged table cells**: Do not use `rowSpan`, `colSpan`,
758
- `gridSpan`, `hMerge`, `vMerge`, or top-level merge lists in native table
759
- metadata. `svg_to_pptx.py --native-objects` rejects them so merged-cell tables
760
- do not silently degrade into incorrect grids. Keep merged-cell tables on the
761
- default SVG fallback route, or merge cells manually in PowerPoint after native
762
- export.
763
-
764
- **Category chart schema**: `column`, `bar`, `line`, `area`, `pie`,
765
- `doughnut`, `pieOfPie`, `barOfPie`, and `radar` use `categories` plus
766
- `series[].values`. Pie-family charts (`pie`, `doughnut`, `pieOfPie`, and
767
- `barOfPie`) must have exactly one series; the exporter assigns per-category
768
- slice colors so single-series charts do not collapse into one solid color.
769
- Column and bar charts may set per-point colors with `series[].point_colors`
770
- or `series[].pointColors`; the list must match `series[].values` length.
771
- Classic category charts may set native PowerPoint data labels with
772
- `data_labels`. Use `data_labels: true` for default value labels, or an object
773
- with `show_value`, `position`, `number_format`, `font_size`, `font_family`,
774
- `bold`, `color`, and optional per-point `colors`. Supported label positions
775
- depend on chart type: clustered column/bar labels may use `outside_end`,
776
- `inside_end`, `inside_base`, or `center`; stacked / percent-stacked column/bar
777
- labels may use `inside_end`, `inside_base`, or `center`; line labels may use
778
- `above`, `center`, or `best_fit`; area labels do not emit a native label
779
- position. To label only selected data points, use `data_labels.points` with
780
- zero-based `idx` plus optional per-point `position`, `number_format`,
781
- `font_size`, `font_family`, `bold`, and `color`.
782
-
783
- **Combo chart schema**: `combo` uses shared `categories` plus either `plots[]`
784
- or typed `series[]`. Each plot supports `type: "column" | "line" | "area"`,
785
- its own `series`, and optional `axis: "secondary"` for a right-side value axis.
786
- Typed `series[]` accepts the same `type` and `axis` fields per series, and
787
- adjacent compatible series are grouped into the same PowerPoint plot. Area
788
- series may set `fill_opacity` / `fillOpacity` as a `0..1` SVG opacity value
789
- when the SVG fallback uses a transparent area fill under an opaque line. A line plot with `area_fill: true`
790
- is exported as a PowerPoint area chart under the hood; `fill_opacity` only sets
791
- the fill style and does not trigger conversion by itself. Combo export layers
792
- area plots below columns and lines while preserving the original series indices.
793
- Line and area series may set `line_width` / `lineWidth` in SVG px units to
794
- match fallback `stroke-width`.
795
-
796
- **XY chart schema**: `scatter` and `bubble` use `series[].x` + `series[].y`; `bubble` also requires one `series[].size` / `series[].sizes` value per point. `series[].points` is also accepted as `[x, y]` / `[x, y, size]` tuples or `{x, y, size}` objects.
797
-
798
- **Chart typography**: Native classic chart typography mirrors the visible SVG
799
- fallback. Copy fallback chart text sizes into metadata using the same px-style
800
- unit as SVG text (`1px = 0.75pt`). Put the shared visible chart font in
801
- `style.font_family`, and override local chart text objects or `data_labels`
802
- with `font_family` only when the fallback visibly differs. If omitted, the
803
- exporter infers the shared font family and base chart text size from visible
804
- fallback text inside the native marker, but explicit metadata remains the
805
- stable contract when roles differ. Typical mappings are chart title
806
- (`title_font_size`), chart subtitle (`subtitle_font_size`), chart labels
807
- (`axis_font_size`, shared by axis titles / ticks / legend unless the fallback
808
- differs), and notes (`note_font_size`). Use `axis_title_font_size`,
809
- `legend_font_size`, or per-entry companion `font_size` only when the fallback
810
- visibly uses a separate size. When no explicit fallback size exists for a role,
811
- default to compact PowerPoint text: `title_font_size: 16` (12pt),
812
- `subtitle_font_size: 12` (9pt), `axis_font_size: 12` (9pt), and
813
- `note_font_size: 12` (9pt).
814
-
815
- **Chart chrome metadata**: Text that is visually part of the chart must be in
816
- metadata, not only in SVG fallback children; metadata MUST still match visible
817
- fallback chrome. `title` becomes the native chart title on classic charts; it
818
- is not an object name, so use `name` for semantic object naming. `subtitle`
819
- becomes the second rich-text line of that classic chart title. `title`,
820
- `subtitle`, and axis-title values may be strings or objects with `text`,
821
- `font_size`, `font_family`, and `color` when the fallback uses local role
822
- typography. `svg_quality_checker.py` rejects `title`, `subtitle`, or axis-title
823
- metadata whose text is not visible inside the native marker's fallback. Direct
824
- `--native-objects` export keeps the chart native but omits that inconsistent
825
- chrome with a warning. chartEx keeps PowerPoint's empty `<cx:title>` and emits
826
- the title / subtitle as companion editable text boxes until chartEx rich titles
827
- are validated. Axis
828
- titles are optional and explicit: use `axis_titles` with
829
- `category`, `value`, `x`, `y`, or `secondary_value` keys, or the root aliases
830
- `category_axis_title`, `value_axis_title`, `x_axis_title`, `y_axis_title`, and
831
- `secondary_value_axis_title`; do not add semantic axis titles that are not
832
- visible in the fallback. Set `show_value_axis_labels: false` when the fallback
833
- keeps category labels but omits numeric value-axis tick labels, such as a radar
834
- chart without radial coordinates. Native legends are metadata-controlled: use
835
- `show_legend: true` and `legend_position` only when the fallback's legend is
836
- meant to be replaced by PowerPoint's native legend.
837
- Companion text such as `caption`, `source`, `note`, `notes`, `footnote`, and
838
- `footnotes` is exported as editable PPT text boxes next to the native chart. A
839
- companion entry may be a string or an object with `text`, `x`, `y`, `width`,
840
- `height`, `font_size`, `color`, `align`, and `bold`; explicit bounds are
841
- recommended so the native export matches the SVG fallback placement. Explicit
842
- companion bounds are slide coordinates, not local coordinates inside a
843
- transformed marker group. Use companion text for chart captions, source notes,
844
- center labels, and freeform annotations; use `data_labels` for values that
845
- belong to chart points.
846
-
847
- **Chart color styling**: For classic native charts, `style.colors` sets series
848
- colors. The exporter also writes explicit chart-area fill, plot-area fill,
849
- axis line, gridline, and label text colors so PowerPoint does not substitute a
850
- white/default-theme chart. If omitted, the exporter infers these colors from
851
- the visible SVG fallback: the largest panel-like `<rect>` becomes the chart
852
- background, fallback text supplies label color, and fallback strokes supply
853
- axis/grid colors. Override any of them explicitly under `style` with
854
- `chart_area_fill`, `plot_area_fill`, `text_color`, `axis_color`, and
855
- `grid_color`; use `"none"` for transparent chart or plot area fill. Color
856
- values may be `#RRGGBB`, `#RGB`, `rgb(...)` / `rgba(...)`, or common CSS names
857
- such as `white`, `black`, and `gray`; the exporter normalizes them to 6-digit
858
- OOXML RGB. Bar and column series also disable PowerPoint's negative-value
859
- inversion so negative bars keep the same series fill instead of turning into
860
- white/theme fill.
861
-
862
- **PowerPoint chartEx schema**: `treemap`, `sunburst`, `histogram`, `pareto`,
863
- `boxWhisker`, `waterfall`, and `funnel` use Office 2016+ chartEx parts. Use
864
- these input shapes:
865
-
866
- | Type | Required data |
867
- |---|---|
868
- | `treemap`, `sunburst` | `values` plus either `levels` (`levels[level][point]`) or path-style `categories` (`[["Region", "Group", "Leaf"], ...]`) |
869
- | `treemap` display note | Top-level group labels default to `overlapping`; override with `parent_label_layout: "banner" \| "overlapping" \| "none"`. PowerPoint labels only the top level and leaves — intermediate levels group tiles spatially without labels (sunburst shows every ring). |
870
- | `histogram` | `values` |
871
- | `pareto`, `waterfall`, `funnel` | `categories` + `values`; `waterfall` also accepts `subtotals` / `subtotal_indices` point indexes |
872
- | `boxWhisker` | `series[].values`; optional `series[].categories` per value |
873
-
874
- > Note: chartEx files are valid PPTX and editable in PowerPoint; non-Microsoft
875
- > renderers can display a limited subset.
876
-
877
- **Stock chart schema**: `stock` uses numeric Excel date serials in
878
- `categories` or `dates`, plus exactly four series in open / high / low / close
879
- order. Use either `series` with four entries, or top-level `open`, `high`,
880
- `low`, and `close` arrays.
881
-
882
- **Deferred chart types**: Exploded pie / doughnut variants, `map`, `heatmap`,
883
- `bullet`, and `gantt` are intentionally outside the current native-object
884
- support boundary. The exporter fails fast for these types until each mapping is
885
- implemented and validated one by one.
886
-
887
- **Supported chart types**:
888
-
889
- - `column`, `bar`: `clustered`, `stacked`, or `percentStacked` (`grouping`)
890
- - `line`: `standard`, `stacked`, or `percentStacked` (`grouping`); `line` or `lineMarker` (`line_style`, default `line` / no markers)
891
- - `area`: `standard`, `stacked`, or `percentStacked` (`grouping`)
892
- - `pie`: exactly one series, per-slice colors
893
- - `doughnut`: exactly one series, per-slice colors
894
- - `pieOfPie`, `barOfPie`: exactly one series, per-slice colors
895
- - `radar`, `radarMarkers`, `radarFilled`
896
- - `scatter`: `marker` (default), `lineMarker`, `line`, `smoothMarker`, or `smooth` (`scatter_style`)
897
- - `bubble`: x/y/size series
898
- - `combo`: `column`, `line`, and `area` plots, optional secondary value axis
899
- - `treemap`, `sunburst`: hierarchical chartEx charts
900
- - `histogram`, `pareto`
901
- - `boxWhisker`
902
- - `waterfall`, `funnel`
903
- - `stock`: open / high / low / close series
904
-
905
- 3D chart aliases (`3DColumn`, `3DBar`, `3DLine`, `3DArea`, `3DPie`, cone,
906
- cylinder, pyramid variants, and `surface`) are intentionally unsupported. They
907
- add compatibility risk without meaningful presentation value.
908
-
909
- Native chart legends are off by default because right-side legends routinely
910
- steal plot area in PPT. Add `show_legend: true` only when the legend is needed;
911
- `legend_position` defaults to `bottom` and also accepts `top`, `left`, or
912
- `right`.
913
-
914
- **Forbidden — native marker transforms**: Do not rotate, skew, or matrix-transform native table/chart marker groups. Translate / scale is accepted; complex transforms fail export because PowerPoint native table/chart frames do not preserve arbitrary SVG transforms.
915
-
916
- ### transform: rotate — Element Rotation
917
-
918
- Rotation converts to native PPTX `<a:xfrm rot="...">`. Supported on all element types: `rect`, `circle`, `ellipse`, `line`, `path`, `polygon`, `polyline`, `image`, and `text`.
919
-
920
- ```xml
921
- <!-- Rotated decorative element -->
922
- <rect x="100" y="100" width="60" height="60" fill="#1A73E8" fill-opacity="0.1"
923
- transform="rotate(45, 130, 130)"/>
924
-
925
- <!-- Rotated text label -->
926
- <text x="50" y="400" font-size="14" fill="#999999"
927
- transform="rotate(-90, 50, 400)">Y-Axis Label</text>
928
- ```
929
-
930
- **Syntax**: `rotate(angle)` or `rotate(angle, cx, cy)` where `cx,cy` is the rotation center. Positive angles rotate clockwise.
931
-
932
- ### Arc Paths — Donut / Pie Charts
933
-
934
- Calculate arc endpoint coordinates precisely with trigonometry. Never estimate — small errors produce wildly wrong shapes.
935
-
936
- **Calculation formula** (center `cx,cy`, radius `r`, angle `θ` in degrees):
937
- ```
938
- x = cx + r × cos(θ × π / 180)
939
- y = cy + r × sin(θ × π / 180)
940
- ```
941
-
942
- **Key rules**:
943
- 1. Start at **-90°** (12 o'clock position) and go clockwise
944
- 2. Each sector spans `percentage × 360°`
945
- 3. Use **large-arc flag = 1** when the sector is > 180°, **0** otherwise
946
- 4. sweep-direction = 1 (clockwise) for outer arc, 0 (counter-clockwise) for inner arc returning
947
- 5. **Always verify** that the sum of all sector angles equals 360° and that the last sector's end point matches the first sector's start point
948
-
949
- **Example — 75% donut sector** (center 400,400, outer r=180, inner r=100):
950
- ```
951
- Start angle: -90° → outer(400, 220), inner(400, 300)
952
- End angle: -90+270=180° → outer(220, 400), inner(300, 400)
953
- Large-arc flag: 1 (270° > 180°)
954
-
955
- <path d="M 400,220 A 180,180 0 1,1 220,400 L 300,400 A 100,100 0 1,0 400,300 Z"/>
956
- ```
957
-
958
- ### Polygon Arrows on Diagonal Lines
959
-
960
- > For connector lines prefer `marker-end`/`marker-start` (§1.1). For chunky/wide solid/non-connector arrows, use standalone polygon or path.
961
-
962
- Horizontal/vertical lines can use simple point offsets for `<polygon>` arrowheads. Diagonal lines need triangle vertices rotated to match line direction.
963
-
964
- **Method** — calculate triangle points using the line's direction vector:
965
-
966
- ```
967
- Given line from (x1,y1) to (x2,y2):
968
- 1. Direction vector: dx = x2-x1, dy = y2-y1
969
- 2. Normalize: len = √(dx²+dy²), ux = dx/len, uy = dy/len
970
- 3. Perpendicular: px = -uy, py = ux
971
- 4. Arrow tip = (x2, y2)
972
- 5. Back point 1 = (x2 - ux×12 + px×5, y2 - uy×12 + py×5)
973
- 6. Back point 2 = (x2 - ux×12 - px×5, y2 - uy×12 - py×5)
974
- ```
975
-
976
- **Example — diagonal line** from (260,310) to (370,430):
977
- ```
978
- dx=110, dy=120, len≈162.8, ux=0.676, uy=0.737
979
- px=-0.737, py=0.676
980
- Tip: (370, 430)
981
- Back1: (370-8.1-3.7, 430-8.8+3.4) = (358.2, 424.6)
982
- Back2: (370-8.1+3.7, 430-8.8-3.4) = (365.6, 417.8)
983
-
984
- <polygon points="370,430 365.6,417.8 358.2,424.6" fill="#C8A96E"/>
985
- ```
986
-
987
- ⚠️ Never use a fixed downward/rightward triangle on a diagonal line — arrow will point wrong.
988
-
989
- ---
990
-
991
- ## 8. Project Directory Structure
992
-
993
- ```
994
- project/
995
- ├── svg_output/ # Raw SVGs (Executor output, contains placeholders)
996
- ├── svg_final/ # Post-processed final SVGs (finalize_svg.py output)
997
- ├── images/ # Image assets (user-provided + AI-generated)
998
- ├── notes/ # Speaker notes (.md files matching SVG names)
999
- │ └── total.md # Complete speaker notes document (before splitting)
1000
- ├── templates/ # Project templates (if any)
1001
- └── *.pptx # Exported PPT file
1002
- ```
1
+ # Shared Technical Standards
2
+
3
+ Common technical constraints for PPT Master, eliminating cross-role file duplication.
4
+
5
+ ---
6
+
7
+ ## 1. SVG Banned Features Blacklist
8
+
9
+ The following are **forbidden** in generated SVGs — PPT export breaks otherwise:
10
+
11
+ ### 1.0 Text characters: must be well-formed XML
12
+
13
+ SVG is strict XML. Two rules for all text and attribute values:
14
+
15
+ | Character category | Required form | Forbidden form |
16
+ |---|---|---|
17
+ | Typography & symbols (em dash, en dash, ©, ®, →, ·, NBSP, full-width punctuation, emoji…) | **Raw Unicode characters** — write `—` `–` `©` `®` `→` directly | HTML named entities — `&mdash;` `&ndash;` `&copy;` `&reg;` `&rarr;` `&middot;` `&nbsp;` `&hellip;` `&bull;` etc. |
18
+ | XML reserved characters (`&`, `<`, `>`, `"`, `'`) | **XML entities only** — `&amp;` `&lt;` `&gt;` `&quot;` `&apos;` (e.g. `R&amp;D`, `error &lt; 5%`) | Bare `&` `<` `>` (e.g. `R&D`, `error < 5%`) |
19
+
20
+ One offending character invalidates the file and aborts export. Numeric refs (`&#160;` / `&#xa0;`) are XML-legal but discouraged.
21
+
22
+ **Structural blacklist** (in addition to the character rules above):
23
+
24
+ | Banned Feature | Description |
25
+ |----------------|-------------|
26
+ | `mask` | Masks |
27
+ | `<style>` | Embedded stylesheets |
28
+ | `class` | CSS selector attributes (`id` inside `<defs>` is a legitimate reference and is NOT banned) |
29
+ | External CSS | External stylesheet links |
30
+ | `<foreignObject>` | Embedded external content |
31
+ | `<symbol>` + `<use>` | Symbol reference reuse |
32
+ | `textPath` | Text along a path |
33
+ | `@font-face` | Custom font declarations |
34
+ | `<animate*>` / `<set>` | SVG animations |
35
+ | `<script>` / event attributes | Scripts and interactivity |
36
+ | `<iframe>` | Embedded frames |
37
+
38
+ > **`marker-start` / `marker-end` is conditionally allowed** — see §1.1 for constraints. The converter maps qualifying markers to native DrawingML `<a:headEnd>` / `<a:tailEnd>`.
39
+ >
40
+ > **`clipPath` on `<image>` is conditionally allowed** — see §1.2 for constraints. The converter maps qualifying clip shapes to native DrawingML picture geometry (`<a:prstGeom>` or `<a:custGeom>`).
41
+ >
42
+ > **`<pattern>` fills are conditionally allowed** — see §7 *Pattern Fill* for the required `data-pptx-pattern` annotation and the closed OOXML preset enum. Hand-drawn pattern geometry is NOT honored; the converter emits the named PPTX preset only. Missing or invalid preset values produce diagonal stripes (warning) or schema-failed PPTX (error).
43
+ >
44
+ > **Replacing `<mask>` effects** — DrawingML has no per-pixel alpha. Route by effect:
45
+ > - Image gradient overlay (vignette/fade/tint) → stacked `<rect>` with `<linearGradient>`/`<radialGradient>` (§6 Image Overlay)
46
+ > - Non-rectangular image crop (circle/rounded/hexagon) → `clipPath` on `<image>` (§1.2)
47
+ > - Inner glow / soft-edge → `<filter>` with `<feGaussianBlur>` (§6 Glow)
48
+ > - Drop shadow → filter shadow or layered rect (§6 Shadow)
49
+ >
50
+ > Pixel-level alpha effects (text-knockout image fills, arbitrary alpha composites) have no PPT path — bake into the source image at Image_Generator stage.
51
+
52
+ ---
53
+
54
+ ### 1.1 Line-end Markers (Conditionally Allowed)
55
+
56
+ `marker-start` and `marker-end` on `<line>` and `<path>` elements are allowed **only** when the referenced `<marker>` satisfies all of the following:
57
+
58
+ | Requirement | Reason |
59
+ |-------------|--------|
60
+ | Marker `<marker>` element defined inside `<defs>` | Converter looks up marker defs via id index |
61
+ | `orient="auto"` | DrawingML arrow auto-rotates along the line tangent; other orient values will not round-trip |
62
+ | Marker shape is **one of**: closed 3-vertex path/polygon (triangle), closed 4-vertex path/polygon (diamond), `<circle>` / `<ellipse>` (oval) | These three map cleanly to DrawingML `type="triangle" / "diamond" / "oval"`. Any other shape is silently dropped with a warning. |
63
+ | Marker child's `fill` **matches** the parent line's `stroke` color | In DrawingML the arrow head inherits the line color — a mismatched marker fill will look wrong on export. |
64
+ | `markerWidth` / `markerHeight` roughly in `3–15` range | Mapped to `sm` (<6) / `med` (6–12) / `lg` (>12) size buckets. |
65
+
66
+ **Use boundary**:
67
+
68
+ - `marker-start` / `marker-end`: only for connector arrows where the line is primary
69
+ - For block / chunky / solid arrows (arrow body is the visual object), use standalone closed `<path>` / `<polygon>`; see `templates/charts/chevron_process.svg` or `templates/charts/process_flow.svg`
70
+
71
+ **Supported DrawingML mapping**:
72
+
73
+ | SVG Marker Shape | DrawingML Output |
74
+ |------------------|------------------|
75
+ | `<path d="M0,0 L10,5 L0,10 Z"/>` (triangle) | `<a:tailEnd type="triangle" w="med" len="med"/>` |
76
+ | `<polygon points="0,0 10,5 0,10"/>` | `<a:tailEnd type="triangle" w="med" len="med"/>` |
77
+ | 4-vertex closed path/polygon | `<a:tailEnd type="diamond" .../>` |
78
+ | `<circle cx="5" cy="5" r="4"/>` | `<a:tailEnd type="oval" .../>` |
79
+
80
+ **Recommended template** — a standard arrow-head definition ready to reuse:
81
+
82
+ ```xml
83
+ <defs>
84
+ <marker id="arrowHead" markerWidth="10" markerHeight="10" refX="9" refY="5"
85
+ orient="auto" markerUnits="strokeWidth">
86
+ <path d="M0,0 L10,5 L0,10 Z" fill="#1976D2"/>
87
+ </marker>
88
+ </defs>
89
+ <line x1="100" y1="200" x2="400" y2="200" stroke="#1976D2" stroke-width="3"
90
+ marker-end="url(#arrowHead)"/>
91
+ ```
92
+
93
+ > ⚠️ Unclassifiable marker shapes (curved paths, multi-segment, >4 vertices) are silently dropped — line renders without arrow. Use a manual `<polygon>` for exotic shapes.
94
+
95
+ ---
96
+
97
+ ### 1.2 Image Clipping (Conditionally Allowed)
98
+
99
+ `clip-path` on `<image>` elements is allowed when the referenced `<clipPath>` satisfies the following:
100
+
101
+ | Requirement | Reason |
102
+ |-------------|--------|
103
+ | `<clipPath>` element defined inside `<defs>` | Converter looks up clip defs via id index |
104
+ | Contains a **single** shape child | First child is used; multiple children are not composited |
105
+ | Shape is one of: `<circle>`, `<ellipse>`, `<rect>` (with rx/ry), `<path>`, `<polygon>` | These map to DrawingML geometry (preset or custom) |
106
+ | Used **only on `<image>` elements** | Non-image elements with clip-path are **forbidden** |
107
+
108
+ **Use boundary**:
109
+
110
+ - Only on `<image>` for non-rectangular crops (circular avatars, rounded frames, hexagons)
111
+ - NOT on shapes (`<rect>`/`<circle>`/`<path>`/`<g>`/`<text>`) — draw the target shape directly. A rect clipped to a circle is just a circle.
112
+ - PowerPoint's SVG renderer doesn't handle `clipPath`; only the Native PPTX converter does.
113
+
114
+ **Supported DrawingML mapping**:
115
+
116
+ | SVG Clip Shape | DrawingML Output | Use Case |
117
+ |----------------|------------------|----------|
118
+ | `<circle>` / `<ellipse>` | `<a:prstGeom prst="ellipse"/>` | Circular avatar, oval frame |
119
+ | `<rect rx="..."/>` | `<a:prstGeom prst="roundRect"/>` with adj value | Rounded rectangle photo frame |
120
+ | `<path>` / `<polygon>` | `<a:custGeom>` with path commands | Hexagon, diamond, custom shape |
121
+
122
+ **Recommended template** — circular image clip:
123
+
124
+ ```xml
125
+ <defs>
126
+ <clipPath id="avatarClip">
127
+ <circle cx="200" cy="200" r="100"/>
128
+ </clipPath>
129
+ </defs>
130
+ <image href="../images/photo.jpg" x="100" y="100" width="200" height="200"
131
+ clip-path="url(#avatarClip)" preserveAspectRatio="xMidYMid slice"/>
132
+ ```
133
+
134
+ **Rounded rectangle clip** — for card-style image frames:
135
+
136
+ ```xml
137
+ <defs>
138
+ <clipPath id="cardClip">
139
+ <rect x="60" y="120" width="400" height="250" rx="16"/>
140
+ </clipPath>
141
+ </defs>
142
+ <image href="../images/banner.jpg" x="60" y="120" width="400" height="250"
143
+ clip-path="url(#cardClip)" preserveAspectRatio="xMidYMid slice"/>
144
+ ```
145
+
146
+ > ⚠️ `clip-path` on non-image elements is FORBIDDEN — quality checker errors out. Draw target geometry directly.
147
+
148
+ ---
149
+
150
+ ## 2. PPT Compatibility Alternatives
151
+
152
+ | Banned Syntax | Correct Alternative |
153
+ |---------------|---------------------|
154
+ | `fill="rgba(255,255,255,0.1)"` | `fill="#FFFFFF" fill-opacity="0.1"` |
155
+ | `<g opacity="0.2">...</g>` | Set `fill-opacity` / `stroke-opacity` on each child element individually |
156
+ | `<image opacity="0.3"/>` | Overlay a `<rect fill="background-color" opacity="0.7"/>` mask layer after the image |
157
+
158
+ **Mnemonic**: PPT does not recognize rgba, group opacity, or image opacity.
159
+
160
+ > Arrows: prefer `marker-end` for connector lines (§1.1) — converter produces native auto-rotating arrow heads. For block/chunky arrows, use standalone closed shapes; see `templates/charts/chevron_process.svg` and `templates/charts/process_flow.svg`.
161
+
162
+ ---
163
+
164
+ ## 3. Canvas Format Quick Reference
165
+
166
+ > See [`canvas-formats.md`](canvas-formats.md) for the full format table (presentations / social / marketing) and the format-selection decision tree.
167
+
168
+ ---
169
+
170
+ ## 4. Basic SVG Rules
171
+
172
+ - **viewBox** MUST match the canvas dimensions; it is the single source of truth for canvas size. Root `width`/`height` are optional compatibility attributes and are not used as PPT Master canvas authority.
173
+ - **Background**: Use `<rect>` to define the page background color
174
+ - **`<tspan>`** has two purposes: (1) manual line breaks (use `dy` or explicit `y`); (2) inline run formatting on the same line (color/weight/size). `<foreignObject>` is FORBIDDEN. See "Single logical line" rule below.
175
+ - **Fonts**: every `font-family` stack MUST resolve to pre-installed exported Latin / EA typefaces (Microsoft YaHei / SimSun / Arial / Times New Roman / Consolas …); `@font-face` is FORBIDDEN. Full rule: [`strategist.md §g`](strategist.md).
176
+ - **Styles**: inline only (`fill=""`, `font-size=""`); `<style>`/`class` FORBIDDEN (`id` inside `<defs>` is fine)
177
+ - **Colors**: HEX only; transparency via `fill-opacity`/`stroke-opacity`
178
+ - **Images**: `<image href="../images/xxx.png" preserveAspectRatio="xMidYMid slice"/>`
179
+ - **Icons**: `<use data-icon="<library>/<name>" x="" y="" width="48" height="48" fill="#HEX"/>` (auto-embedded post-processing). Always include library prefix. One stylistic library per deck (`chunk-filled`/`tabler-filled`/`tabler-outline`/`phosphor-duotone`); `simple-icons` only for real brand marks. See [`../templates/icons/README.md`](../templates/icons/README.md).
180
+
181
+ ### Inline Text Runs (Single Logical Line = Single `<text>`)
182
+
183
+ One logical line — even with mixed colors/weights/sizes — MUST be one `<text>` with inline `<tspan>` children. Never use multiple adjacent `<text>` elements. The converter maps each `<tspan>` to a `<a:r>` run within the same PPT text frame, keeping the line as one editable shape.
184
+
185
+ ✅ **DO** — one `<text>` → one text frame with three runs:
186
+
187
+ ```xml
188
+ <text x="100" y="200" font-size="24" fill="#333333">
189
+ 实现<tspan fill="#1A73E8" font-weight="bold">10倍</tspan>效率提升
190
+ </text>
191
+ ```
192
+
193
+ ❌ **DON'T** — three side-by-side `<text>` elements become three separate text frames in PPT (breaks edit-as-one-line, risks alignment drift, makes spacing fragile):
194
+
195
+ ```xml
196
+ <text x="100" y="200" font-size="24" fill="#333333">实现</text>
197
+ <text x="160" y="200" font-size="24" fill="#1A73E8" font-weight="bold">10倍</text>
198
+ <text x="240" y="200" font-size="24" fill="#333333">效率提升</text>
199
+ ```
200
+
201
+ **⚠️ Inline tspans must NOT carry `x`/`y`/`dy`** — those mark a new line, and `flatten_tspan` will split into a separate text frame. `dx` is safe (kerning, stays inline). Only set `x`/`y`/`dy` on tspans that genuinely start a new line.
202
+
203
+ **Multi-line `<text>` with per-line emphasis works**: an outer line-break tspan (with `x` + `dy` or `y`) MAY contain nested inline tspans for color/weight/size — converter walks nested tspans and emits one run per styled segment:
204
+
205
+ ```xml
206
+ <text x="80" y="190" font-size="18" fill="#333333">
207
+ <tspan x="80" dy="0">完成率<tspan fill="#4CAF50" font-weight="bold">98%</tspan>超预期</tspan>
208
+ <tspan x="80" dy="35">成本降低<tspan fill="#F44336" font-weight="bold">¥120万</tspan></tspan>
209
+ </text>
210
+ ```
211
+
212
+ ❌ **DON'T** — same-line column jump via `<tspan x="...">`:
213
+
214
+ ```xml
215
+ <text x="100" y="200" font-size="18" fill="#333333">
216
+ <tspan x="100">左列</tspan><tspan x="600" font-weight="bold">右列</tspan>
217
+ </text>
218
+ ```
219
+
220
+ `x` on a tspan starts a new line, splitting into two independent text frames. For two-column layouts, write two `<text>` elements.
221
+
222
+ **Default — lift key information.** Uniform-styled paragraphs read as walls of text. Wrap these in `<tspan fill="..." font-weight="bold">`:
223
+
224
+ - **Numerical results** — percentages, multipliers (`10x`), absolute amounts (`¥120万`)
225
+ - **Contrasts** — gain/loss, before/after, target/actual
226
+ - **One or two load-bearing nouns per sentence** — the term that carries the insight
227
+
228
+ Do NOT highlight: connectives, common verbs, every noun, decorative adjectives, structural text (footer/axis/legend/page number/labels).
229
+
230
+ Color: use the deck's primary brand color for emphasis. Reserve green/red for actual positive/negative semantics.
231
+
232
+ ❌ **DON'T** — uniform-styled paragraph buries the insight:
233
+
234
+ ```xml
235
+ <text x="80" y="200" font-size="20" fill="#333333">
236
+ 2024年公司营收同比增长35%达到12亿元创历史新高
237
+ </text>
238
+ ```
239
+
240
+ ✅ **DO** — same line, key data lifted:
241
+
242
+ ```xml
243
+ <text x="80" y="200" font-size="20" fill="#333333">
244
+ 2024年公司营收同比<tspan fill="#1A73E8" font-weight="bold">增长35%</tspan>达到<tspan fill="#1A73E8" font-weight="bold">12亿元</tspan>创历史新高
245
+ </text>
246
+ ```
247
+
248
+ ### Element Grouping (Mandatory)
249
+
250
+ Wrap logically related elements in top-level `<g id="...">` groups. Produces PowerPoint groups in PPTX, making slides easier to select/move/edit and providing stable anchors for optional per-element entrance animation.
251
+
252
+ > ⚠️ Only `<g opacity="...">` is banned (§2). Plain `<g>` for grouping is required.
253
+
254
+ **Animation-ready rule**: direct children of `<svg>` should be semantic groups, not raw drawing atoms. Aim for **3–8 top-level content `<g id>` groups per slide** (the 3–8 budget excludes page chrome — see below); each content group becomes one entrance step under the chosen `--animation-trigger` mode (one click in `on-click`, one cascade slot in `after-previous`, parallel in `with-previous`).
255
+
256
+ **Chrome groups are excluded automatically.** The exporter treats top-level groups whose id contains chrome tokens as page chrome and skips them in the animation sequence — they appear together with the slide. Tokens (matched against id after splitting on `-` / `_`): `background`, `bg`, `decoration` / `decorations` / `decor`, `header`, `footer`, `chrome`, `watermark`, `pagenumber` / `pagenum` / `page-number`, `nav`, `logo`, `rule`. So `<g id="bg-texture">`, `<g id="cover-footer">`, `<g id="p03-header">`, `<g id="bottom-decor">`, `<g id="nav">`, `<g id="logo-area">`, `<g id="column-rule">` all skip animation while keeping their `<g>` wrapper for editing/grouping. Use these naming conventions for chrome — do **not** strip the `<g>` wrapper.
257
+
258
+ **What to group**:
259
+
260
+ | Grouping Unit | Contains |
261
+ |---------------|----------|
262
+ | Card / panel | Background rect + (optional shadow only if the card floats over a photo/colored panel — see §6) + icon + title + body text |
263
+ | Process step | Number circle + icon + label + description |
264
+ | List item | Bullet / number + icon + title + description |
265
+ | Icon-text combo | Icon element + adjacent label |
266
+ | Page header | Title + subtitle + accent decoration |
267
+ | Page footer | Page number + branding |
268
+ | Decorative cluster | Related decorative shapes (rings, orbs, dots) |
269
+
270
+ **Do not**:
271
+
272
+ - Put the whole slide into one giant `<g>`; that leaves only one animation step.
273
+ - Leave many top-level `<rect>` / `<text>` / `<path>` elements ungrouped; fallback animation is capped at 8 primitives and dense flat pages may skip animation.
274
+ - Split every icon, text line, or decorative mark into separate top-level groups; that creates too many click steps.
275
+ - Use anonymous top-level groups. Every top-level semantic group needs a descriptive `id`.
276
+
277
+ **Example**:
278
+
279
+ ```xml
280
+ <g id="card-benefits-1">
281
+ <!-- This card floats over a colored panel — shadow is appropriate. On a flat white canvas, omit the filter. -->
282
+ <rect x="60" y="115" width="565" height="260" rx="20" fill="#FFFFFF" filter="url(#shadow)"/>
283
+ <use data-icon="chunk-filled/bolt" x="108" y="163" width="44" height="44" fill="#0071E3"/>
284
+ <text x="105" y="270" font-size="56" font-weight="bold" fill="#0071E3">10×</text>
285
+ <text x="250" y="270" font-size="30" font-weight="bold" fill="#1D1D1F">Faster</text>
286
+ <text x="105" y="310" font-size="18" fill="#6E6E73">Reduce production time from days to hours.</text>
287
+ </g>
288
+ ```
289
+
290
+ **Naming**: descriptive `id` on top-level `<g>` is **required** (e.g., `card-1`, `step-discover`, `header`, `footer`). Each top-level `<g id>` becomes one anchor for per-element entrance animation in PPTX export; without it, the exporter falls back to at most 8 top-level primitives or skips animation on dense pages.
291
+
292
+ ---
293
+
294
+ ## 5. Post-processing Pipeline (3 Steps)
295
+
296
+ Must be executed in order — skipping or adding extra flags is FORBIDDEN:
297
+
298
+ ```bash
299
+ # 1. Split speaker notes into per-page note files
300
+ python3 scripts/total_md_split.py <project_path>
301
+
302
+ # 2. SVG post-processing (icon embedding, image crop/embed/optimization, text flattening, rounded rect to path)
303
+ python3 scripts/finalize_svg.py <project_path>
304
+
305
+ # 3. Export PPTX (embeds speaker notes by default)
306
+ python3 scripts/svg_to_pptx.py <project_path>
307
+ # Output (default-flow mode):
308
+ # exports/<project_name>_<timestamp>.pptx ← native pptx (canonical output)
309
+ # backup/<timestamp>/svg_output/ ← Executor SVG source backup (always written)
310
+ #
311
+ # Add --svg-snapshot to additionally emit:
312
+ # exports/<project_name>_<timestamp>_svg.pptx ← SVG snapshot pptx (sibling of native pptx)
313
+ ```
314
+
315
+ **Optional animation flags** (only when the user asks):
316
+ - `-t <effect>` — page transition (`fade` / `push` / `wipe` / `split` / `strips` / `cover` / `random` / `none`; default `fade`)
317
+ - `-a <effect>` — per-element entrance animation (`fade` / `auto` / `mixed` / `random` / one of 22 named effects / `none`; **default `none`** — pages appear as a whole, no auto element builds; opt in with `auto`, which maps effect from group id — image-like ids cycle zoom/dissolve/circle/box/diamond/wheel, other matches map to a single effect, unmatched ids cycle fade/wipe/fly/zoom). Anchors on top-level `<g id="...">` groups.
318
+ - `--animation-trigger {on-click,with-previous,after-previous}` — Start mode matching PowerPoint's animation-pane Start dropdown. Default `after-previous` (cascade on slide entry; pace via `--animation-stagger <seconds>`); `on-click` advances per click; `with-previous` plays all groups together.
319
+ - `--animation-config <path>` — optional object-level animation sidecar. Default: `<project>/animations.json` when present.
320
+ - `--auto-advance <seconds>` — kiosk-style auto-play
321
+
322
+ **Optional recorded narration** (only when the user asks for narrated/video export):
323
+
324
+ ```bash
325
+ python3 scripts/notes_to_audio.py <project_path> --voice zh-CN-XiaoxiaoNeural
326
+ python3 scripts/svg_to_pptx.py <project_path> --recorded-narration audio
327
+ ```
328
+
329
+ - `notes_to_audio.py` reads split `notes/*.md` files and writes one audio file per slide to `audio/`. Default `edge` output is MP3; configured cloud providers may output MP3 or WAV depending on provider settings.
330
+ - `--recorded-narration audio` prepares PowerPoint's recorded timings and narrations: every slide needs matching `m4a` / `mp3` / `wav` audio, every duration must be readable by `ffprobe`, and `on-click` object animation is rejected.
331
+ - `--recorded-narration audio` embeds matching audio, keeps speaker notes, and sets slide timings from audio duration.
332
+ - `--narration-audio-dir audio` is the lower-level embedding path for partial audio coverage; it does not prepare a complete recorded-timings export.
333
+ - Long-audio import and automatic long-audio splitting are not supported.
334
+
335
+ Full reference: [`animations.md`](animations.md).
336
+
337
+ **Prohibited**:
338
+ - NEVER use `cp` as a substitute for `finalize_svg.py`
339
+ - NEVER force `-s output` for the legacy/preview pptx (PowerPoint's internal SVG parser drops icons and rounded corners). Default auto-split already gives native the high-fidelity source it needs without affecting legacy.
340
+ - NEVER use `--only` (it suppresses one of the two output files)
341
+
342
+ > Source-directory split: by default `svg_to_pptx.py` reads `svg_output/` for the native pptx (preserves icon `<use>`, image `preserveAspectRatio` as native picture-crop metadata, rounded rect `rx/ry` → `prstGeom roundRect`) and `svg_final/` for the legacy/preview pptx (PowerPoint's internal SVG parser needs the flattened form). Pass `-s output` or `-s final` only when you specifically want both products to read from a single source.
343
+
344
+ **Default — raster size control**: `finalize_svg.py` optimizes raster images using a rendered-size budget of `2x` display pixels with a `2560px` maximum dimension; it may crop pixels for the flattened SVG snapshot. Native `svg_to_pptx.py` defaults to `--image-sizing cap`: it downscales only oversized full source images to `--image-max-dimension 2560`, keeps display cropping as editable PPT picture-crop metadata, and does not shrink a picture merely because its current SVG placement is small. Opaque PNG photos may become JPEG; transparent assets remain PNG. Use `finalize_svg.py --no-compress` / a higher `--max-dimension` only for diagnostic SVG snapshots, `svg_to_pptx.py --no-image-optimize` only when the native PPTX must retain original image bytes, and `svg_to_pptx.py --image-sizing display --image-scale 2` only for aggressive size reduction.
345
+
346
+ **Re-run rule**: Any change to `svg_output/` after post-processing requires re-running Steps 2-3. Step 1 only re-runs if `notes/total.md` changed.
347
+
348
+ ---
349
+
350
+ ## 6. Shadow & Overlay Techniques
351
+
352
+ > `<mask>` elements and `<image opacity="...">` are banned. Always use stacked `<rect>` or gradient overlays instead (see §2).
353
+
354
+ ### Shadow
355
+
356
+ > **Shadow is restraint, not default.** The "designed" feel comes from absence, not abundance.
357
+
358
+ #### When to use
359
+
360
+ Only when the element genuinely floats above another layer:
361
+ - Card / quote bubble / annotation on a photo or colored panel
362
+ - Single primary CTA or "recommended" item picked out from peers
363
+ - Overlay layer (callout, tooltip, modal emphasis)
364
+ - Floating image card on a textured background
365
+
366
+ #### When NOT to use
367
+
368
+ - Background panels / dividers / decorative bars — they are the floor
369
+ - Equal peer cards in a 2/3/4-up grid — keep all flat
370
+ - Containers with visible border, gradient fill, or strong tint — redundant
371
+ - Body-text paragraph containers — disrupts scan rhythm
372
+ - Decorative lines / dividers / icons — they are symbols, not objects
373
+ - Pages with only one content container — no second layer to lift above
374
+ - Dark backgrounds — black shadows vanish; use 1px low-opacity white stroke or outer glow
375
+
376
+ **Reference — not a constraint**: 2-3 shadowed elements per page usually reads cleanest; before adding a 4th, check the extra layering earns its weight — a genuinely complex dashboard may justify more.
377
+
378
+ #### Single light source per page
379
+
380
+ All `feOffset` on a page must share the same `dx`/`dy` direction. Default: `dx="0"`, `dy="4"`-`dy="8"` (light from upper front).
381
+
382
+ #### Restraint over visibility
383
+
384
+ Standard: "the shadow is felt, not seen." If noticed, it's too strong.
385
+ - Resting cards: `flood-opacity` 0.06-0.10
386
+ - Raised elements (CTA, overlay): max `flood-opacity` 0.20
387
+ - Above 0.20 = Office 2007 hard-shadow look
388
+ - Color: near-black at low opacity, or a darker tint of background. Brand-color shadow only on accent elements sharing that hue.
389
+
390
+ #### Two-tier elevation maximum
391
+
392
+ A page may have at most two non-floor tiers.
393
+
394
+ | Tier | When | dy | stdDeviation | flood-opacity |
395
+ |------|------|----|--------------|---------------|
396
+ | Floor (no shadow) | Backgrounds, peer-grid cards, dividers, body-text containers | — | — | — |
397
+ | Resting | Cards on photos/panels, secondary callouts | 2-4 | 4-8 | 0.06-0.10 |
398
+ | Raised | Primary CTA, focused/recommended card, overlay | 6-10 | 10-16 | 0.12-0.20 |
399
+
400
+ #### Don't stack visual-weight tools
401
+
402
+ Pick **one** per container: shadow, border, gradient fill, or strong tint. Stacking = instant template look.
403
+
404
+ ---
405
+
406
+ #### Filter Soft Shadow — Recommended
407
+
408
+ Best for: cards, floating panels, elevated elements. The `svg_to_pptx` converter automatically converts `feGaussianBlur` + `feOffset` into native PPTX `<a:outerShdw>`.
409
+
410
+ ```xml
411
+ <defs>
412
+ <filter id="softShadow" x="-15%" y="-15%" width="140%" height="140%">
413
+ <feGaussianBlur in="SourceAlpha" stdDeviation="12"/>
414
+ <feOffset dx="0" dy="6" result="offsetBlur"/>
415
+ <feFlood flood-color="#000000" flood-opacity="0.10" result="shadowColor"/>
416
+ <feComposite in="shadowColor" in2="offsetBlur" operator="in" result="shadow"/>
417
+ <feMerge>
418
+ <feMergeNode in="shadow"/>
419
+ <feMergeNode in="SourceGraphic"/>
420
+ </feMerge>
421
+ </filter>
422
+ </defs>
423
+ <rect x="60" y="60" width="400" height="240" rx="12" fill="#FFFFFF" filter="url(#softShadow)"/>
424
+ ```
425
+
426
+ Recommended parameters (see "Two-tier elevation maximum" above for tier guidance):
427
+ ```
428
+ stdDeviation: 4–16 (resting cards: 4–8; raised elements: 10–16)
429
+ flood-opacity: 0.06–0.10 (resting cards — default)
430
+ 0.12–0.20 (raised elements only — primary CTA, overlay)
431
+ NEVER > 0.20 (Office 2007 hard-shadow look)
432
+ dy: 2–10 (resting: 2–4; raised: 6–10)
433
+ dx: 0–2 (must match every other shadow on the page — single light source)
434
+ ```
435
+
436
+ #### Colored Shadow
437
+
438
+ Best for: accent buttons, brand-colored cards. Use the element's own color family instead of black.
439
+
440
+ ```xml
441
+ <filter id="colorShadow" x="-15%" y="-15%" width="140%" height="140%">
442
+ <feGaussianBlur in="SourceAlpha" stdDeviation="10"/>
443
+ <feOffset dx="0" dy="6" result="offsetBlur"/>
444
+ <feFlood flood-color="#1A73E8" flood-opacity="0.20" result="shadowColor"/>
445
+ <feComposite in="shadowColor" in2="offsetBlur" operator="in" result="shadow"/>
446
+ <feMerge>
447
+ <feMergeNode in="shadow"/>
448
+ <feMergeNode in="SourceGraphic"/>
449
+ </feMerge>
450
+ </filter>
451
+ ```
452
+
453
+ Replace `flood-color` with the element's brand color. Keep `flood-opacity` 0.12-0.20. Reserve for the single primary CTA per page — using on every button defeats the cue.
454
+
455
+ #### Glow Effect
456
+
457
+ Best for: title highlights, key metrics, hero text. The converter automatically converts `feGaussianBlur` without `feOffset` into native PPTX `<a:glow>`.
458
+
459
+ ```xml
460
+ <defs>
461
+ <filter id="titleGlow" x="-30%" y="-30%" width="160%" height="160%">
462
+ <feGaussianBlur in="SourceAlpha" stdDeviation="6" result="blur"/>
463
+ <feFlood flood-color="#1A73E8" flood-opacity="0.45" result="glowColor"/>
464
+ <feComposite in="glowColor" in2="blur" operator="in" result="glow"/>
465
+ <feMerge>
466
+ <feMergeNode in="glow"/>
467
+ <feMergeNode in="SourceGraphic"/>
468
+ </feMerge>
469
+ </filter>
470
+ </defs>
471
+ <text x="640" y="360" text-anchor="middle" font-size="48" fill="#1A73E8" filter="url(#titleGlow)">Key Insight</text>
472
+ ```
473
+
474
+ Recommended parameters:
475
+ ```
476
+ stdDeviation: 4–8 (smaller = subtle, larger = prominent)
477
+ flood-color: brand color or accent color (NOT black)
478
+ flood-opacity: 0.35–0.55 (stronger than shadow for visibility)
479
+ ```
480
+
481
+ **vs shadow**: no `<feOffset>` (or dx=0/dy=0). The converter uses this to distinguish glow from shadow.
482
+
483
+ #### Layered Rect Shadow — High-Compatibility Fallback
484
+
485
+ Best for: maximum compatibility with older PowerPoint versions. Stack 2–3 semi-transparent rectangles behind the main card:
486
+
487
+ ```xml
488
+ <!-- Shadow layers (back to front, largest offset first) -->
489
+ <rect x="68" y="72" width="400" height="240" rx="16" fill="#000000" fill-opacity="0.03"/>
490
+ <rect x="65" y="69" width="400" height="240" rx="14" fill="#000000" fill-opacity="0.05"/>
491
+ <rect x="62" y="66" width="400" height="240" rx="12" fill="#1A73E8" fill-opacity="0.04"/>
492
+ <!-- Main card -->
493
+ <rect x="60" y="60" width="400" height="240" rx="12" fill="#FFFFFF"/>
494
+ ```
495
+
496
+ ### Image Overlay
497
+
498
+ #### Linear Gradient Overlay — Most Common
499
+
500
+ Best for: image+text pages. Gradient direction should match text position (text on left → gradient darkens toward left).
501
+
502
+ ```xml
503
+ <image href="..." x="0" y="0" width="1280" height="720" preserveAspectRatio="xMidYMid slice"/>
504
+ <defs>
505
+ <linearGradient id="imgOverlay" x1="0" y1="0" x2="1" y2="0">
506
+ <stop offset="0%" stop-color="#1A1A2E" stop-opacity="0.85"/>
507
+ <stop offset="55%" stop-color="#1A1A2E" stop-opacity="0.30"/>
508
+ <stop offset="100%" stop-color="#1A1A2E" stop-opacity="0"/>
509
+ </linearGradient>
510
+ </defs>
511
+ <rect x="0" y="0" width="1280" height="720" fill="url(#imgOverlay)"/>
512
+ ```
513
+
514
+ #### Bottom Gradient Bar
515
+
516
+ Best for: cover slides and full-image pages with bottom title.
517
+
518
+ ```xml
519
+ <defs>
520
+ <linearGradient id="bottomBar" x1="0" y1="0" x2="0" y2="1">
521
+ <stop offset="0%" stop-color="#000000" stop-opacity="0"/>
522
+ <stop offset="100%" stop-color="#000000" stop-opacity="0.72"/>
523
+ </linearGradient>
524
+ </defs>
525
+ <rect x="0" y="380" width="1280" height="340" fill="url(#bottomBar)"/>
526
+ ```
527
+
528
+ #### Radial Gradient Overlay — Vignette Effect
529
+
530
+ Best for: full-screen atmosphere slides; draws attention to the center.
531
+
532
+ ```xml
533
+ <defs>
534
+ <radialGradient id="vignette" cx="50%" cy="50%" r="70%">
535
+ <stop offset="0%" stop-color="#000000" stop-opacity="0"/>
536
+ <stop offset="100%" stop-color="#000000" stop-opacity="0.58"/>
537
+ </radialGradient>
538
+ </defs>
539
+ <rect x="0" y="0" width="1280" height="720" fill="url(#vignette)"/>
540
+ ```
541
+
542
+ #### Brand Color Overlay
543
+
544
+ Best for: slides needing strong visual brand identity.
545
+
546
+ ```xml
547
+ <defs>
548
+ <linearGradient id="brandOverlay" x1="0" y1="0" x2="1" y2="0">
549
+ <stop offset="0%" stop-color="#005587" stop-opacity="0.80"/>
550
+ <stop offset="100%" stop-color="#005587" stop-opacity="0.10"/>
551
+ </linearGradient>
552
+ </defs>
553
+ <rect x="0" y="0" width="1280" height="720" fill="url(#brandOverlay)"/>
554
+ ```
555
+
556
+ ### Quick-Reference Table
557
+
558
+ | Scenario | Recommended Technique | Avoid |
559
+ |----------|-----------------------|-------|
560
+ | Card / panel shadow (only when floating over photo/colored panel) | Filter soft shadow (`flood-opacity` 0.06–0.10, single light source) | Hard black shadow, full-page abundance |
561
+ | Equal peer cards in a grid | All flat (no shadow) | Lifting every card uniformly |
562
+ | Page-section background panel | Flat fill, no shadow | Treating panels as floating cards |
563
+ | Accent / CTA button (one per page) | Colored shadow (same hue family, `flood-opacity` 0.12–0.20) | Generic gray shadow, applying to every button |
564
+ | Title / metric highlight | Glow filter (brand color, no offset) | Overuse on body text |
565
+ | Text over image | Linear gradient overlay (direction matches text side) | Uniform flat opacity over whole image |
566
+ | Cover / full-image slide | Bottom gradient bar + brand color | Solid black overlay |
567
+ | Atmosphere / hero slide | Radial vignette | Unprocessed raw image |
568
+ | Max PPT compatibility needed | Layered rect shadow | Filter-based shadow |
569
+
570
+ ---
571
+
572
+ ## 7. Stroke, Text & Shape Effects
573
+
574
+ ### stroke-dasharray — Dashed / Dotted Lines
575
+
576
+ Converts to native PPTX `<a:prstDash>`. Use preset patterns for best results:
577
+
578
+ | SVG Value | PPTX Preset | Best For |
579
+ |-----------|-------------|----------|
580
+ | `4,4` | Dash | General dashed lines, separators |
581
+ | `2,2` | Dot (sysDot) | Subtle dotted borders, placeholder outlines |
582
+ | `8,4` | Long dash | Timeline connectors, flow arrows |
583
+ | `8,4,2,4` | Long dash-dot | Technical drawings, dimension lines |
584
+
585
+ ```xml
586
+ <rect x="60" y="60" width="400" height="240" rx="12"
587
+ fill="none" stroke="#999999" stroke-width="2" stroke-dasharray="4,4"/>
588
+
589
+ <line x1="100" y1="360" x2="1180" y2="360"
590
+ stroke="#CCCCCC" stroke-width="1" stroke-dasharray="2,2"/>
591
+ ```
592
+
593
+ ### stroke-linejoin
594
+
595
+ Controls how line segments join at corners. Supported values convert to native PPTX line join types:
596
+
597
+ | SVG Value | PPTX Equivalent | Best For |
598
+ |-----------|-----------------|----------|
599
+ | `round` | Round join | Smooth polyline charts, organic shapes |
600
+ | `bevel` | Bevel join | Technical diagrams |
601
+ | `miter` | Miter join (default) | Sharp-cornered rectangles, arrows |
602
+
603
+ ```xml
604
+ <polyline points="100,200 200,100 300,200" fill="none"
605
+ stroke="#1A73E8" stroke-width="3" stroke-linejoin="round"/>
606
+ ```
607
+
608
+ ### text-decoration
609
+
610
+ Supported text decorations convert to native PPTX text formatting:
611
+
612
+ | SVG Value | PPTX Equivalent | Best For |
613
+ |-----------|-----------------|----------|
614
+ | `underline` | Single underline | Emphasis, links, key terms |
615
+ | `line-through` | Strikethrough | Removed items, before/after comparisons |
616
+
617
+ ```xml
618
+ <text x="100" y="200" font-size="20" fill="#333333" text-decoration="underline">Important Term</text>
619
+
620
+ <!-- Per-tspan decoration -->
621
+ <text x="100" y="240" font-size="18" fill="#333333">
622
+ Regular text <tspan text-decoration="line-through" fill="#999999">old value</tspan> new value
623
+ </text>
624
+ ```
625
+
626
+ ### Gradient Fill — linearGradient & radialGradient
627
+
628
+ Gradients defined in `<defs>` and referenced via `fill="url(#id)"` convert to native PPTX `<a:gradFill>`. Use them as shape fills (not just overlays) for polished surfaces.
629
+
630
+ **Linear gradient** — best for buttons, header bars, background panels:
631
+
632
+ ```xml
633
+ <defs>
634
+ <linearGradient id="btnGrad" x1="0" y1="0" x2="1" y2="0">
635
+ <stop offset="0%" stop-color="#1A73E8"/>
636
+ <stop offset="100%" stop-color="#0D47A1"/>
637
+ </linearGradient>
638
+ </defs>
639
+ <rect x="540" y="600" width="200" height="48" rx="24" fill="url(#btnGrad)"/>
640
+ ```
641
+
642
+ **Radial gradient** — best for spotlight backgrounds, circular accents:
643
+
644
+ ```xml
645
+ <defs>
646
+ <radialGradient id="spotBg" cx="50%" cy="50%" r="70%">
647
+ <stop offset="0%" stop-color="#1A73E8" stop-opacity="0.15"/>
648
+ <stop offset="100%" stop-color="#1A73E8" stop-opacity="0"/>
649
+ </radialGradient>
650
+ </defs>
651
+ <circle cx="640" cy="360" r="300" fill="url(#spotBg)"/>
652
+ ```
653
+
654
+ ### Pattern Fill — `<pattern>` with PPTX preset annotation
655
+
656
+ `<pattern>` fills convert to native PPTX `<a:pattFill prst="...">` — but only PPTX's built-in preset patterns are reachable. The converter does **not** render hand-drawn `<path>` geometry inside the pattern; instead it reads two annotations off the `<pattern>` element and emits the matching DrawingML preset.
657
+
658
+ **Prefer explicit geometry when spacing matters.** A `<pattern>` renders at PowerPoint's **fixed preset density** — you cannot reproduce a specific tile size (e.g. a 40px grid). For grids / textures whose spacing or line weight is part of the design, draw the lines as **one `<path>` with all lines as subpaths** (`M40 0V720 M80 0V720 … M0 40H1280 …`, `fill="none" stroke=…`) — the converter supports `M/L/H/V` and multi-subpath, so it becomes **one editable vector shape that reproduces the exact spacing** across all four renderers. Reserve `<pattern>` + `data-pptx-pattern` for **round-tripping an existing PPTX** (decks imported via `pptx_to_svg`), where the source genuinely used a native preset fill. For pure display where no PPT-side editing is needed, `--svg-snapshot` is the other faithful option.
659
+
660
+ **Required annotations** (only when you intentionally use a `<pattern>` preset):
661
+
662
+ | Attribute | Purpose | Without it |
663
+ |---|---|---|
664
+ | `data-pptx-pattern="<preset>"` | Names the PPTX preset (one of the enum below) | Falls back to `ltUpDiag` — diagonal stripes, not your geometry |
665
+ | Child `<rect fill="<bg-hex>"/>` | Background color of the pattern tile | `bg` falls back to `#FFFFFF`, painting over the page background |
666
+
667
+ The child `<path>`'s `stroke` becomes the foreground color (the pattern's line color).
668
+
669
+ ```xml
670
+ <defs>
671
+ <pattern id="bpGrid" x="0" y="0" width="40" height="40"
672
+ patternUnits="userSpaceOnUse" data-pptx-pattern="lgGrid">
673
+ <rect width="40" height="40" fill="#0E2A47"/>
674
+ <path d="M 40 0 L 0 0 0 40" fill="none" stroke="#2D4A6B" stroke-width="0.6"/>
675
+ </pattern>
676
+ </defs>
677
+ <rect width="1280" height="720" fill="url(#bpGrid)"/>
678
+ ```
679
+
680
+ **Valid `data-pptx-pattern` values** (OOXML `ST_PresetPatternVal` — closed enum, anything outside makes PowerPoint open with "needs to be repaired"):
681
+
682
+ | Category | Values |
683
+ |---|---|
684
+ | Grids | `smGrid` · `lgGrid` · `dotGrid` *(no `ltGrid` — common typo)* |
685
+ | Diagonal lines | `ltUpDiag` · `ltDnDiag` · `dkUpDiag` · `dkDnDiag` · `wdUpDiag` · `wdDnDiag` · `dashUpDiag` · `dashDnDiag` · `diagCross` |
686
+ | Horizontal / vertical lines | `horz` · `vert` · `ltHorz` · `ltVert` · `dkHorz` · `dkVert` · `narHorz` · `narVert` · `dashHorz` · `dashVert` · `cross` |
687
+ | Percent fills | `pct5` · `pct10` · `pct20` · `pct25` · `pct30` · `pct40` · `pct50` · `pct60` · `pct70` · `pct75` · `pct80` · `pct90` |
688
+ | Checks & confetti | `smCheck` · `lgCheck` · `smConfetti` · `lgConfetti` |
689
+ | Decorative | `horzBrick` · `diagBrick` · `weave` · `plaid` · `trellis` · `zigZag` · `wave` · `sphere` · `divot` · `shingle` · `solidDmnd` · `openDmnd` · `dotDmnd` |
690
+
691
+ > `svg_quality_checker.py` warns on missing `data-pptx-pattern` and errors on values outside the enum. Catch these pre-export — PowerPoint's repair dialog hides which pattern broke.
692
+
693
+ ### Native PPTX Table / Chart Markers (Experimental)
694
+
695
+ Native PowerPoint tables and Excel-backed charts activate at export time only. The default chart/table route remains hand-authored SVG geometry so the deck stays pixel-stable across PowerPoint / Keynote / LibreOffice / WPS.
696
+
697
+ **Authoring — markers are standard on supported data charts and text-grid tables**: Executor writes the marker at draw time on every data chart whose type falls in the supported set and on every pure text-grid data table ([executor-base.md §3.2](executor-base.md)), so any deck can later form native objects without regeneration. Tables with merged or graphical cells stay unmarked on the SVG fallback route. The marker group supplies both: visible SVG fallback children for browser/live-preview rendering, and JSON metadata for `svg_to_pptx` native export.
698
+
699
+ **Hard rule — activation is the opt-in, dormant unless exported with `--native-objects`**: A marker only declares that a group is eligible for native export. Normal `svg_to_pptx.py` runs keep the fallback SVG children. Pass `--native-objects` only when editability in PowerPoint matters more than cross-renderer layout fidelity: it emits the PowerPoint object and skips the fallback children to avoid duplicates. Native styling preserves the core palette, text, axis, grid, and background colors where possible, but it is still a PowerPoint chart/table object rather than a pixel-identical SVG drawing.
700
+
701
+ | Marker | Native output | Required metadata |
702
+ |---|---|---|
703
+ | `<g data-pptx-native="table">` | `<p:graphicFrame>` with `<a:tbl>` | bounds + `columns` or `rows` |
704
+ | `<g data-pptx-native="chart">` | `<p:graphicFrame>` with `c:chart` / `cx:chart` + chart part + embedded workbook | bounds + `type`, plus chart data |
705
+
706
+ **Metadata placement**: Put JSON in a child `<metadata data-pptx-native="...">`. Attribute JSON (`data-pptx-json="..."`) is supported but harder to XML-escape correctly.
707
+
708
+ **Bounds**: Provide `x`, `y`, `width`, and `height` in metadata, or as
709
+ `data-pptx-x` / `data-pptx-y` / `data-pptx-width` / `data-pptx-height` on the
710
+ marker group. If any bound is omitted, the exporter infers the object frame
711
+ from the visible fallback geometry; this keeps SVG fallback and native object
712
+ placement aligned.
713
+
714
+ **Validation**: `svg_quality_checker.py` validates native marker kind, JSON
715
+ metadata, bounds/fallback availability, table rows/columns, supported chart
716
+ type, and chart data shape before export.
717
+
718
+ ```xml
719
+ <g id="p03-revenue-chart" data-pptx-native="chart">
720
+ <metadata data-pptx-native="chart">
721
+ {
722
+ "x": 120, "y": 150, "width": 520, "height": 320,
723
+ "type": "column",
724
+ "title": "Revenue by Segment",
725
+ "categories": ["Q1", "Q2", "Q3"],
726
+ "series": [
727
+ {"name": "Cloud", "values": [12, 15, 19]},
728
+ {"name": "Services", "values": [8, 9, 11]}
729
+ ]
730
+ }
731
+ </metadata>
732
+ <!-- Visible SVG fallback for live preview / non-native export goes here. -->
733
+ </g>
734
+ ```
735
+
736
+ **Table schema**: Native tables are rectangular DrawingML grids. Use `columns`
737
+ for the optional header row and `rows` for body rows; shorter rows are padded
738
+ with blank cells unless `strict_grid: true` is set. Use `column_widths` and
739
+ `row_heights` as relative weights. Cell objects accept `text`, `fill`, `color`,
740
+ `align`, `valign`, `bold`, `font_size`, `padding`, `border_color`, and
741
+ `border_width`; the same `padding`, `border_color`, and `border_width` keys may
742
+ also live under `style` as table defaults. Native table typography mirrors the
743
+ visible SVG fallback: put `style.font_family` and `style.font_size` on the
744
+ marker from the table text already drawn, then use `style.header_font_size` or
745
+ per-cell `font_size` only when the fallback visibly differs. If the fallback
746
+ has no explicit table font, use the deck body family and locked body size from
747
+ `spec_lock.md`.
748
+
749
+ **Hard rule — table metadata is the native source of truth**: Every row,
750
+ summary line, value, and cell-level style that must survive
751
+ `--native-objects` must be present in `columns` / `rows`. SVG fallback text is
752
+ discarded during native export. `svg_quality_checker.py` warns when visible
753
+ fallback `<text>` inside a native table marker does not appear in metadata.
754
+ For numeric or currency columns, use cell objects with `align: "r"`; SVG
755
+ `text-anchor="end"` does not carry into the native table.
756
+
757
+ **Forbidden — native merged table cells**: Do not use `rowSpan`, `colSpan`,
758
+ `gridSpan`, `hMerge`, `vMerge`, or top-level merge lists in native table
759
+ metadata. `svg_to_pptx.py --native-objects` rejects them so merged-cell tables
760
+ do not silently degrade into incorrect grids. Keep merged-cell tables on the
761
+ default SVG fallback route, or merge cells manually in PowerPoint after native
762
+ export.
763
+
764
+ **Category chart schema**: `column`, `bar`, `line`, `area`, `pie`,
765
+ `doughnut`, `pieOfPie`, `barOfPie`, and `radar` use `categories` plus
766
+ `series[].values`. Pie-family charts (`pie`, `doughnut`, `pieOfPie`, and
767
+ `barOfPie`) must have exactly one series; the exporter assigns per-category
768
+ slice colors so single-series charts do not collapse into one solid color.
769
+ Column and bar charts may set per-point colors with `series[].point_colors`
770
+ or `series[].pointColors`; the list must match `series[].values` length.
771
+ Classic category charts may set native PowerPoint data labels with
772
+ `data_labels`. Use `data_labels: true` for default value labels, or an object
773
+ with `show_value`, `position`, `number_format`, `font_size`, `font_family`,
774
+ `bold`, `color`, and optional per-point `colors`. Supported label positions
775
+ depend on chart type: clustered column/bar labels may use `outside_end`,
776
+ `inside_end`, `inside_base`, or `center`; stacked / percent-stacked column/bar
777
+ labels may use `inside_end`, `inside_base`, or `center`; line labels may use
778
+ `above`, `center`, or `best_fit`; area labels do not emit a native label
779
+ position. To label only selected data points, use `data_labels.points` with
780
+ zero-based `idx` plus optional per-point `position`, `number_format`,
781
+ `font_size`, `font_family`, `bold`, and `color`.
782
+
783
+ **Combo chart schema**: `combo` uses shared `categories` plus either `plots[]`
784
+ or typed `series[]`. Each plot supports `type: "column" | "line" | "area"`,
785
+ its own `series`, and optional `axis: "secondary"` for a right-side value axis.
786
+ Typed `series[]` accepts the same `type` and `axis` fields per series, and
787
+ adjacent compatible series are grouped into the same PowerPoint plot. Area
788
+ series may set `fill_opacity` / `fillOpacity` as a `0..1` SVG opacity value
789
+ when the SVG fallback uses a transparent area fill under an opaque line. A line plot with `area_fill: true`
790
+ is exported as a PowerPoint area chart under the hood; `fill_opacity` only sets
791
+ the fill style and does not trigger conversion by itself. Combo export layers
792
+ area plots below columns and lines while preserving the original series indices.
793
+ Line and area series may set `line_width` / `lineWidth` in SVG px units to
794
+ match fallback `stroke-width`.
795
+
796
+ **XY chart schema**: `scatter` and `bubble` use `series[].x` + `series[].y`; `bubble` also requires one `series[].size` / `series[].sizes` value per point. `series[].points` is also accepted as `[x, y]` / `[x, y, size]` tuples or `{x, y, size}` objects.
797
+
798
+ **Chart typography**: Native classic chart typography mirrors the visible SVG
799
+ fallback. Copy fallback chart text sizes into metadata using the same px-style
800
+ unit as SVG text (`1px = 0.75pt`). Put the shared visible chart font in
801
+ `style.font_family`, and override local chart text objects or `data_labels`
802
+ with `font_family` only when the fallback visibly differs. If omitted, the
803
+ exporter infers the shared font family and base chart text size from visible
804
+ fallback text inside the native marker, but explicit metadata remains the
805
+ stable contract when roles differ. Typical mappings are chart title
806
+ (`title_font_size`), chart subtitle (`subtitle_font_size`), chart labels
807
+ (`axis_font_size`, shared by axis titles / ticks / legend unless the fallback
808
+ differs), and notes (`note_font_size`). Use `axis_title_font_size`,
809
+ `legend_font_size`, or per-entry companion `font_size` only when the fallback
810
+ visibly uses a separate size. When no explicit fallback size exists for a role,
811
+ default to compact PowerPoint text: `title_font_size: 16` (12pt),
812
+ `subtitle_font_size: 12` (9pt), `axis_font_size: 12` (9pt), and
813
+ `note_font_size: 12` (9pt).
814
+
815
+ **Chart chrome metadata**: Text that is visually part of the chart must be in
816
+ metadata, not only in SVG fallback children; metadata MUST still match visible
817
+ fallback chrome. `title` becomes the native chart title on classic charts; it
818
+ is not an object name, so use `name` for semantic object naming. `subtitle`
819
+ becomes the second rich-text line of that classic chart title. `title`,
820
+ `subtitle`, and axis-title values may be strings or objects with `text`,
821
+ `font_size`, `font_family`, and `color` when the fallback uses local role
822
+ typography. `svg_quality_checker.py` rejects `title`, `subtitle`, or axis-title
823
+ metadata whose text is not visible inside the native marker's fallback. Direct
824
+ `--native-objects` export keeps the chart native but omits that inconsistent
825
+ chrome with a warning. chartEx keeps PowerPoint's empty `<cx:title>` and emits
826
+ the title / subtitle as companion editable text boxes until chartEx rich titles
827
+ are validated. Axis
828
+ titles are optional and explicit: use `axis_titles` with
829
+ `category`, `value`, `x`, `y`, or `secondary_value` keys, or the root aliases
830
+ `category_axis_title`, `value_axis_title`, `x_axis_title`, `y_axis_title`, and
831
+ `secondary_value_axis_title`; do not add semantic axis titles that are not
832
+ visible in the fallback. Set `show_value_axis_labels: false` when the fallback
833
+ keeps category labels but omits numeric value-axis tick labels, such as a radar
834
+ chart without radial coordinates. Native legends are metadata-controlled: use
835
+ `show_legend: true` and `legend_position` only when the fallback's legend is
836
+ meant to be replaced by PowerPoint's native legend.
837
+ Companion text such as `caption`, `source`, `note`, `notes`, `footnote`, and
838
+ `footnotes` is exported as editable PPT text boxes next to the native chart. A
839
+ companion entry may be a string or an object with `text`, `x`, `y`, `width`,
840
+ `height`, `font_size`, `color`, `align`, and `bold`; explicit bounds are
841
+ recommended so the native export matches the SVG fallback placement. Explicit
842
+ companion bounds are slide coordinates, not local coordinates inside a
843
+ transformed marker group. Use companion text for chart captions, source notes,
844
+ center labels, and freeform annotations; use `data_labels` for values that
845
+ belong to chart points.
846
+
847
+ **Chart color styling**: For classic native charts, `style.colors` sets series
848
+ colors. The exporter also writes explicit chart-area fill, plot-area fill,
849
+ axis line, gridline, and label text colors so PowerPoint does not substitute a
850
+ white/default-theme chart. If omitted, the exporter infers these colors from
851
+ the visible SVG fallback: the largest panel-like `<rect>` becomes the chart
852
+ background, fallback text supplies label color, and fallback strokes supply
853
+ axis/grid colors. Override any of them explicitly under `style` with
854
+ `chart_area_fill`, `plot_area_fill`, `text_color`, `axis_color`, and
855
+ `grid_color`; use `"none"` for transparent chart or plot area fill. Color
856
+ values may be `#RRGGBB`, `#RGB`, `rgb(...)` / `rgba(...)`, or common CSS names
857
+ such as `white`, `black`, and `gray`; the exporter normalizes them to 6-digit
858
+ OOXML RGB. Bar and column series also disable PowerPoint's negative-value
859
+ inversion so negative bars keep the same series fill instead of turning into
860
+ white/theme fill.
861
+
862
+ **PowerPoint chartEx schema**: `treemap`, `sunburst`, `histogram`, `pareto`,
863
+ `boxWhisker`, `waterfall`, and `funnel` use Office 2016+ chartEx parts. Use
864
+ these input shapes:
865
+
866
+ | Type | Required data |
867
+ |---|---|
868
+ | `treemap`, `sunburst` | `values` plus either `levels` (`levels[level][point]`) or path-style `categories` (`[["Region", "Group", "Leaf"], ...]`) |
869
+ | `treemap` display note | Top-level group labels default to `overlapping`; override with `parent_label_layout: "banner" \| "overlapping" \| "none"`. PowerPoint labels only the top level and leaves — intermediate levels group tiles spatially without labels (sunburst shows every ring). |
870
+ | `histogram` | `values` |
871
+ | `pareto`, `waterfall`, `funnel` | `categories` + `values`; `waterfall` also accepts `subtotals` / `subtotal_indices` point indexes |
872
+ | `boxWhisker` | `series[].values`; optional `series[].categories` per value |
873
+
874
+ > Note: chartEx files are valid PPTX and editable in PowerPoint; non-Microsoft
875
+ > renderers can display a limited subset.
876
+
877
+ **Stock chart schema**: `stock` uses numeric Excel date serials in
878
+ `categories` or `dates`, plus exactly four series in open / high / low / close
879
+ order. Use either `series` with four entries, or top-level `open`, `high`,
880
+ `low`, and `close` arrays.
881
+
882
+ **Deferred chart types**: Exploded pie / doughnut variants, `map`, `heatmap`,
883
+ `bullet`, and `gantt` are intentionally outside the current native-object
884
+ support boundary. The exporter fails fast for these types until each mapping is
885
+ implemented and validated one by one.
886
+
887
+ **Supported chart types**:
888
+
889
+ - `column`, `bar`: `clustered`, `stacked`, or `percentStacked` (`grouping`)
890
+ - `line`: `standard`, `stacked`, or `percentStacked` (`grouping`); `line` or `lineMarker` (`line_style`, default `line` / no markers)
891
+ - `area`: `standard`, `stacked`, or `percentStacked` (`grouping`)
892
+ - `pie`: exactly one series, per-slice colors
893
+ - `doughnut`: exactly one series, per-slice colors
894
+ - `pieOfPie`, `barOfPie`: exactly one series, per-slice colors
895
+ - `radar`, `radarMarkers`, `radarFilled`
896
+ - `scatter`: `marker` (default), `lineMarker`, `line`, `smoothMarker`, or `smooth` (`scatter_style`)
897
+ - `bubble`: x/y/size series
898
+ - `combo`: `column`, `line`, and `area` plots, optional secondary value axis
899
+ - `treemap`, `sunburst`: hierarchical chartEx charts
900
+ - `histogram`, `pareto`
901
+ - `boxWhisker`
902
+ - `waterfall`, `funnel`
903
+ - `stock`: open / high / low / close series
904
+
905
+ 3D chart aliases (`3DColumn`, `3DBar`, `3DLine`, `3DArea`, `3DPie`, cone,
906
+ cylinder, pyramid variants, and `surface`) are intentionally unsupported. They
907
+ add compatibility risk without meaningful presentation value.
908
+
909
+ Native chart legends are off by default because right-side legends routinely
910
+ steal plot area in PPT. Add `show_legend: true` only when the legend is needed;
911
+ `legend_position` defaults to `bottom` and also accepts `top`, `left`, or
912
+ `right`.
913
+
914
+ **Forbidden — native marker transforms**: Do not rotate, skew, or matrix-transform native table/chart marker groups. Translate / scale is accepted; complex transforms fail export because PowerPoint native table/chart frames do not preserve arbitrary SVG transforms.
915
+
916
+ ### transform: rotate — Element Rotation
917
+
918
+ Rotation converts to native PPTX `<a:xfrm rot="...">`. Supported on all element types: `rect`, `circle`, `ellipse`, `line`, `path`, `polygon`, `polyline`, `image`, and `text`.
919
+
920
+ ```xml
921
+ <!-- Rotated decorative element -->
922
+ <rect x="100" y="100" width="60" height="60" fill="#1A73E8" fill-opacity="0.1"
923
+ transform="rotate(45, 130, 130)"/>
924
+
925
+ <!-- Rotated text label -->
926
+ <text x="50" y="400" font-size="14" fill="#999999"
927
+ transform="rotate(-90, 50, 400)">Y-Axis Label</text>
928
+ ```
929
+
930
+ **Syntax**: `rotate(angle)` or `rotate(angle, cx, cy)` where `cx,cy` is the rotation center. Positive angles rotate clockwise.
931
+
932
+ ### Arc Paths — Donut / Pie Charts
933
+
934
+ Calculate arc endpoint coordinates precisely with trigonometry. Never estimate — small errors produce wildly wrong shapes.
935
+
936
+ **Calculation formula** (center `cx,cy`, radius `r`, angle `θ` in degrees):
937
+ ```
938
+ x = cx + r × cos(θ × π / 180)
939
+ y = cy + r × sin(θ × π / 180)
940
+ ```
941
+
942
+ **Key rules**:
943
+ 1. Start at **-90°** (12 o'clock position) and go clockwise
944
+ 2. Each sector spans `percentage × 360°`
945
+ 3. Use **large-arc flag = 1** when the sector is > 180°, **0** otherwise
946
+ 4. sweep-direction = 1 (clockwise) for outer arc, 0 (counter-clockwise) for inner arc returning
947
+ 5. **Always verify** that the sum of all sector angles equals 360° and that the last sector's end point matches the first sector's start point
948
+
949
+ **Example — 75% donut sector** (center 400,400, outer r=180, inner r=100):
950
+ ```
951
+ Start angle: -90° → outer(400, 220), inner(400, 300)
952
+ End angle: -90+270=180° → outer(220, 400), inner(300, 400)
953
+ Large-arc flag: 1 (270° > 180°)
954
+
955
+ <path d="M 400,220 A 180,180 0 1,1 220,400 L 300,400 A 100,100 0 1,0 400,300 Z"/>
956
+ ```
957
+
958
+ ### Polygon Arrows on Diagonal Lines
959
+
960
+ > For connector lines prefer `marker-end`/`marker-start` (§1.1). For chunky/wide solid/non-connector arrows, use standalone polygon or path.
961
+
962
+ Horizontal/vertical lines can use simple point offsets for `<polygon>` arrowheads. Diagonal lines need triangle vertices rotated to match line direction.
963
+
964
+ **Method** — calculate triangle points using the line's direction vector:
965
+
966
+ ```
967
+ Given line from (x1,y1) to (x2,y2):
968
+ 1. Direction vector: dx = x2-x1, dy = y2-y1
969
+ 2. Normalize: len = √(dx²+dy²), ux = dx/len, uy = dy/len
970
+ 3. Perpendicular: px = -uy, py = ux
971
+ 4. Arrow tip = (x2, y2)
972
+ 5. Back point 1 = (x2 - ux×12 + px×5, y2 - uy×12 + py×5)
973
+ 6. Back point 2 = (x2 - ux×12 - px×5, y2 - uy×12 - py×5)
974
+ ```
975
+
976
+ **Example — diagonal line** from (260,310) to (370,430):
977
+ ```
978
+ dx=110, dy=120, len≈162.8, ux=0.676, uy=0.737
979
+ px=-0.737, py=0.676
980
+ Tip: (370, 430)
981
+ Back1: (370-8.1-3.7, 430-8.8+3.4) = (358.2, 424.6)
982
+ Back2: (370-8.1+3.7, 430-8.8-3.4) = (365.6, 417.8)
983
+
984
+ <polygon points="370,430 365.6,417.8 358.2,424.6" fill="#C8A96E"/>
985
+ ```
986
+
987
+ ⚠️ Never use a fixed downward/rightward triangle on a diagonal line — arrow will point wrong.
988
+
989
+ ---
990
+
991
+ ## 8. Project Directory Structure
992
+
993
+ ```
994
+ project/
995
+ ├── svg_output/ # Raw SVGs (Executor output, contains placeholders)
996
+ ├── svg_final/ # Post-processed final SVGs (finalize_svg.py output)
997
+ ├── images/ # Image assets (user-provided + AI-generated)
998
+ ├── notes/ # Speaker notes (.md files matching SVG names)
999
+ │ └── total.md # Complete speaker notes document (before splitting)
1000
+ ├── templates/ # Project templates (if any)
1001
+ └── *.pptx # Exported PPT file
1002
+ ```