| 1 | # PPT Master Toolset |
| 2 | |
| 3 | This directory contains user-facing scripts for conversion, project setup, direct PPTX template filling, SVG processing, export, recorded narration, and image generation. |
| 4 | |
| 5 | ## Directory Layout |
| 6 | |
| 7 | - Top-level `scripts/`: runnable entry scripts |
| 8 | - `scripts/project_management/`: internals behind `project_manager.py` |
| 9 | - `scripts/source_to_md.py`: unified source-document → Markdown dispatcher |
| 10 | - `scripts/source_to_md/`: source-document → Markdown routing/batch helpers and backend converters (`_dispatcher.py`, `_batch.py`, `pdf_to_md.py`, `doc_to_md.py`, `excel_to_md.py`, `ppt_to_md.py`, `web_to_md.py`) |
| 11 | - `scripts/image_backends/`: internal provider implementations used by `image_gen.py` |
| 12 | - `scripts/tts_backends/`: internal TTS provider implementations used by `notes_to_audio.py` |
| 13 | - `scripts/template_import/`: internal PPTX reference-preparation helpers used by `pptx_template_import.py` |
| 14 | - `scripts/svg_finalize/`: internal post-processing helpers used by `finalize_svg.py` |
| 15 | - `scripts/docs/`: topic-focused script documentation |
| 16 | - `scripts/prompt_audit.py` + `scripts/prompt_audit_manifest.json`: maintainer-only prompt budget/governance lint (see [`docs/prompt_audit.md`](docs/prompt_audit.md)); the manifest is audit-only and never loaded as prompt context |
| 17 | - `scripts/assets/`: static assets consumed by scripts |
| 18 | |
| 19 | ## Quick Start |
| 20 | |
| 21 | Typical end-to-end workflow: |
| 22 | |
| 23 | ```bash |
| 24 | python3 scripts/source_to_md.py <file-or-url-or-dir> [<file-or-url-or-dir> ...] |
| 25 | # or direct backend calls: |
| 26 | python3 scripts/source_to_md/pdf_to_md.py <file.pdf> |
| 27 | # or |
| 28 | python3 scripts/source_to_md/ppt_to_md.py <deck.pptx> |
| 29 | python3 scripts/source_to_md/excel_to_md.py <workbook.xlsx> |
| 30 | python3 scripts/project_manager.py init <project_name> --format ppt169 |
| 31 | python3 scripts/project_manager.py import-sources <project_path> <source_files_or_dirs...> |
| 32 | python3 scripts/total_md_split.py <project_path> |
| 33 | python3 scripts/finalize_svg.py <project_path> |
| 34 | python3 scripts/animation_config.py scaffold <project_path> # optional object-level animation overrides |
| 35 | python3 scripts/svg_to_pptx.py <project_path> |
| 36 | ``` |
| 37 | |
| 38 | After `init`, project-scoped Python CLIs automatically record their command |
| 39 | envelopes and bounded material outcomes in |
| 40 | `<project_path>/validation/workflow.log`; invoke them directly, without a |
| 41 | logging wrapper. The log does not copy the full console stream. |
| 42 | |
| 43 | Repository update: |
| 44 | |
| 45 | ```bash |
| 46 | python3 scripts/update_repo.py |
| 47 | ``` |
| 48 | |
| 49 | ## Script Index |
| 50 | |
| 51 | | Area | Primary scripts | Documentation | |
| 52 | |------|-----------------|---------------| |
| 53 | | Conversion | `source_to_md.py`, `source_to_md/pdf_to_md.py`, `source_to_md/doc_to_md.py`, `source_to_md/excel_to_md.py`, `source_to_md/ppt_to_md.py`, `source_to_md/web_to_md.py`, `pptx_intake.py`, `pptx_to_svg.py` | [docs/conversion.md](./docs/conversion.md) | |
| 54 | | Project management | `project_manager.py`, `workflow_log.py`, `workflow_transcript.py`, `batch_validate.py`, `generate_examples_index.py`, `error_helper.py`, `pptx_template_import.py`, `template_fill_pptx.py`, `native_enhance_pptx.py`, `pptx_delivery_check.py` | [docs/project.md](./docs/project.md) | |
| 55 | | SVG pipeline | `preset_shape_svg.py`, `shape_boolean_svg.py`, `svg_authoring_view.py`, `compact_svg_coordinates.py`, `mirror_template_materialize.py`, `finalize_svg.py`, `svg_to_pptx.py`, `template_preview_pptx.py`, `total_md_split.py`, `svg_quality_checker.py`, `extract_svg_assets.py`, `extract_svg_pictures.py`, `animation_config.py`, `notes_to_audio.py`, `narration_sync.py` | [docs/svg-pipeline.md](./docs/svg-pipeline.md); [native shape authoring](../references/native-shape-authoring.md) | |
| 56 | | PPTX transitions | `pptx_transitions.py` | [docs/pptx-transitions.md](./docs/pptx-transitions.md) | |
| 57 | | PPTX animations | `pptx_animations.py`, `animation_config.py` | [docs/pptx-animations.md](./docs/pptx-animations.md) | |
| 58 | | Spec maintenance | `update_spec.py`, `chart_recall.py` | [docs/update_spec.md](./docs/update_spec.md); [docs/chart-recall.md](./docs/chart-recall.md) | |
| 59 | | Image tools | `image_gen.py`, `latex_render.py`, `analyze_images.py`, `gemini_watermark_remover.py` | [docs/image.md](./docs/image.md) | |
| 60 | | Maintenance smokes | Inline temporary-project commands | [advanced image and motion](./docs/advanced-image-motion-smoke.md); [mask and gradient](./docs/mask-gradient-smoke.md); [multilingual text](./docs/multilingual-text-smoke.md) | |
| 61 | | Repo maintenance | `update_repo.py` | README install/update section | |
| 62 | | Troubleshooting | validation, preview, export, dependency issues | [docs/troubleshooting.md](./docs/troubleshooting.md) | |
| 63 | |
| 64 | ## High-Frequency Commands |
| 65 | |
| 66 | Conversion: |
| 67 | |
| 68 | ```bash |
| 69 | python3 scripts/source_to_md.py <file-or-url-or-dir> [<file-or-url-or-dir> ...] |
| 70 | python3 scripts/source_to_md/pdf_to_md.py <file.pdf> |
| 71 | python3 scripts/source_to_md/ppt_to_md.py <deck.pptx> |
| 72 | python3 scripts/source_to_md/doc_to_md.py <file.docx> |
| 73 | python3 scripts/source_to_md/excel_to_md.py <workbook.xlsx> |
| 74 | python3 scripts/source_to_md/web_to_md.py <url> |
| 75 | python3 scripts/pptx_to_svg.py <deck.pptx> -o <output_dir> # reconstruction/reference SVG import |
| 76 | ``` |
| 77 | |
| 78 | Project setup: |
| 79 | |
| 80 | ```bash |
| 81 | python3 scripts/project_manager.py init <project_name> --format ppt169 |
| 82 | python3 scripts/project_manager.py import-sources <project_path> <source_files_or_dirs...> |
| 83 | python3 scripts/project_manager.py scaffold-spec <project_path> # optional manual helper |
| 84 | python3 scripts/project_manager.py scaffold-lock <project_path> # optional manual helper |
| 85 | python3 scripts/project_manager.py validate <project_path> |
| 86 | python3 scripts/project_manager.py page-context <project_path> P07 --record-usage |
| 87 | python3 scripts/project_manager.py page-context-report <project_path> |
| 88 | ``` |
| 89 | |
| 90 | `page-context` is an on-demand read-only current-page projection for diagnostics, |
| 91 | routing checks, or context measurement; normal generation retains the complete |
| 92 | Design Spec and lock once per valid execution context. Each invocation includes |
| 93 | the global lock projection as a continuity anchor set, not a color/font allowlist; large Design Specs, |
| 94 | prototype, and `templates/charts/` references are emitted only as scoped |
| 95 | path/SHA fingerprints and are read once per execution context. `--bundle` is a |
| 96 | deprecated compatibility no-op. `--record-usage` writes one derived snapshot |
| 97 | under `analysis/page-context/`; exact `o200k_base` token counts are optional and |
| 98 | degrade to `tokens: null` when `tiktoken` is absent. Telemetry may be partial. |
| 99 | |
| 100 | Chart candidate recall: |
| 101 | |
| 102 | ```bash |
| 103 | python3 scripts/chart_recall.py recall --page P03 --tag "time series" --tag "three metrics" --tag "direction over time" |
| 104 | python3 scripts/chart_recall.py validate line_chart |
| 105 | ``` |
| 106 | |
| 107 | Template source import: |
| 108 | |
| 109 | ```bash |
| 110 | python3 scripts/pptx_template_import.py <template.pptx> |
| 111 | python3 scripts/pptx_template_import.py <template.pptx> --manifest-only |
| 112 | python3 scripts/pptx_template_import.py <template.pptx> --inheritance-mode both |
| 113 | python3 scripts/svg_authoring_view.py <imported-svg-or-dir> -o <output-dir> --projection-kind layered |
| 114 | python3 scripts/svg_authoring_view.py <authoring-dir> --refresh-summary |
| 115 | python3 scripts/compact_svg_coordinates.py <template_workspace>/templates --inplace --keep-native-frames |
| 116 | python3 scripts/mirror_template_materialize.py <import_workspace> <empty_template_workspace> |
| 117 | python3 scripts/template_preview_pptx.py <template_workspace> |
| 118 | python3 scripts/template_preview_pptx.py <legacy_template_workspace> --visual-only |
| 119 | ``` |
| 120 | |
| 121 | Template import defaults to the canonical layered `svg/` tree. Use |
| 122 | `--inheritance-mode both` only when a separate self-contained `svg-flat/` |
| 123 | verification tree is required. No derived narrative digest is generated |
| 124 | because `manifest.json` already owns those facts. |
| 125 | |
| 126 | `svg_authoring_view.py` creates a lightweight, non-destructive editable IR |
| 127 | bundle from PPTX-imported SVGs. It removes embedded `txbody` payloads, |
| 128 | duplicate hidden geometry carriers, and import-identity attributes from the |
| 129 | copy while retaining visible fallback geometry, text, images, stable element |
| 130 | ids, root Master/Layout markers, selected native-shape intent, and |
| 131 | document-local `data-pptx-source-ref` values. |
| 132 | Relative local image references are rewritten so the projected copy still |
| 133 | renders from its new location. The bundle's `authoring_summary.json` is the |
| 134 | model-readable current-file index; `authoring_manifest.json` records |
| 135 | source/authoring hashes and object paths for tools without duplicating opaque |
| 136 | payload and does not enter model context. Imported model-facing frames and safe |
| 137 | transform page coordinates use at most two decimals; immutable lossless SVGs |
| 138 | retain the original precision. In-place vector/picture extraction |
| 139 | refreshes the summary automatically; use `--refresh-summary` after other direct |
| 140 | IR edits. The full imported SVG remains unchanged as native-payload backing. |
| 141 | Template creation edits the IR and materializes validated `templates/*.svg`; |
| 142 | the IR directory itself is not a final template or direct release export |
| 143 | source. |
| 144 | |
| 145 | `mirror_template_materialize.py` is the deterministic Type A mirror compiler. |
| 146 | It consumes only the layered `authoring-svg/` IR as editable input, loads its |
| 147 | tool-only manifest internally, and validates it against immutable `svg/`, |
| 148 | `native_structure.json`, |
| 149 | `svg/inheritance.json`, `source_template.pptx`, and any extracted-vector |
| 150 | inventory, then publishes a complete structured template roster atomically. |
| 151 | Unchanged supported Slide-local/slot refs may recover native payload; edited |
| 152 | refs keep their current SVG fallback. Fixed Master/Layout wrappers are expanded |
| 153 | mechanically into direct atoms, source visibility flags become canonical root |
| 154 | metadata, and imported vectors are copied once to `icons/imported/`. Large |
| 155 | opaque `txBody`, shape-style, and custom-geometry payloads are deduplicated into |
| 156 | `templates/native_payloads.json.gz`; repeated native restoration attributes |
| 157 | are stored there as short `data-pptx-native-ref` records. Structural metadata |
| 158 | stays inline, while checker, template-structure validation, and export hydrate |
| 159 | both layers in memory. Legacy inline payload and v1 payload-only stores remain |
| 160 | readable. The v1 execution manifest points to per-prototype |
| 161 | `ppt-master.template-text-slots.v2-min` diagnostic sidecars. They are derived |
| 162 | tool metadata and are not injected into model context. Checker and export |
| 163 | validate output attributes, topology, and resource hashes against the complete |
| 164 | prototype internally. Bitmap assets |
| 165 | go to `images/`; other referenced source assets go to `templates/assets/`. |
| 166 | The destination must be empty, and the command does not write |
| 167 | `templates/design_spec.md`; Template_Designer owns that authored brief. |
| 168 | |
| 169 | `template_preview_pptx.py` reads a template workspace, exports every public `templates/*.svg` prototype as one structured review slide, and verifies the resulting Master/Layout package. Canonical definition-only `layout_<layout_key>.svg` prototypes are registered as reusable Layouts through internal carrier slides that are removed before publication; they never increase the review deck's visible slide count. This is an on-demand review action: its default output is `exports/<template_id>_template_preview.pptx`, and that directory need not exist before the command runs. It refuses an existing output unless an intentional re-export passes `--force`. `--visual-only` is an explicit migration aid for legacy SVG rosters: it creates a slide-local visual review deck without validating or claiming a reusable Master/Layout contract. This diagnostic path does not require a project `spec_lock.md`; it may retain generic theme/text defaults inside its clean one-Master/one-Layout shell. New structured templates use the default mode when a review deck is requested. |
| 170 | |
| 171 | Template fill (direct PPTX, no SVG conversion): |
| 172 | |
| 173 | ```bash |
| 174 | python3 scripts/project_manager.py init <project_name> --format ppt169 |
| 175 | python3 scripts/project_manager.py import-sources <project_path> <source.pptx> <material...> |
| 176 | # Manual fallback when import-sources did not produce analysis/<stem>.slide_library.json: |
| 177 | python3 scripts/template_fill_pptx.py analyze <project_path>/sources/<source.pptx> -o <project_path>/analysis/<stem>.slide_library.json |
| 178 | python3 scripts/template_fill_pptx.py scaffold <project_path>/analysis/<stem>.slide_library.json -o <project_path>/analysis/fill_plan.json --slides "1,3,4" |
| 179 | python3 scripts/template_fill_pptx.py check-plan <project_path>/analysis/<stem>.slide_library.json <project_path>/analysis/fill_plan.json -o <project_path>/analysis/check_report.json |
| 180 | python3 scripts/template_fill_pptx.py apply <project_path>/sources/<source.pptx> <project_path>/analysis/fill_plan.json -o <project_path>/exports/filled.pptx |
| 181 | python3 scripts/template_fill_pptx.py validate <project_path> |
| 182 | ``` |
| 183 | |
| 184 | `apply` requires `fill_plan.json` to have top-level `"status": "confirmed"` unless `--force` is passed. It automatically writes `filled_YYYYMMDD_HHMMSS.pptx` unless the output stem already ends with a timestamp. It preserves source page transitions by default; `--transition <effect>` accepts a canonical effect in the shared native gallery registry documented by [`docs/pptx-transitions.md`](docs/pptx-transitions.md), while old names remain accepted only as compatibility inputs, and `--transition-duration <seconds>` changes a replacement effect's duration. `--transition none` removes the visual effect, `--transition keep` states the preservation policy explicitly, and a per-slide `transition` field in the plan overrides whatever the CLI selects. The object form accepts effect-specific native `effect_options`. |
| 185 | |
| 186 | Native existing-PPTX enhancement (direct PPTX, no SVG conversion): |
| 187 | |
| 188 | ```bash |
| 189 | python3 scripts/native_enhance_pptx.py init <source.pptx> --name <project_slug> |
| 190 | python3 scripts/native_enhance_pptx.py plan <project_path> |
| 191 | python3 scripts/native_enhance_pptx.py validate <project_path> |
| 192 | python3 scripts/native_enhance_pptx.py apply <project_path> |
| 193 | python3 scripts/pptx_delivery_check.py <finished.pptx> |
| 194 | ``` |
| 195 | |
| 196 | Native preset shape authoring (one registry-backed fragment on stdout): |
| 197 | |
| 198 | ```bash |
| 199 | python3 scripts/preset_shape_svg.py list --search arrow |
| 200 | python3 scripts/preset_shape_svg.py describe rightArrow |
| 201 | python3 scripts/preset_shape_svg.py render rightArrow --id process-arrow --frame 120 180 240 96 --fill '#2563EB' |
| 202 | ``` |
| 203 | |
| 204 | The helper never writes a page or project file. Select one exact semantic |
| 205 | stock-shape match, inspect the emitted fragment, and insert it into the |
| 206 | hand-authored SVG with the normal patch workflow. Its project-authored output |
| 207 | is one compact atomic `<g>` with direct registry-generated visible paths; |
| 208 | quality check and export rerender the registry instead of relying on a hidden |
| 209 | carrier, preview wrapper, or stored preview fingerprint. PPTX import and |
| 210 | round-trip SVGs deliberately keep their expanded carrier/preview evidence and |
| 211 | are not rewritten into this authored form. Keep ordinary rectangles, ellipses, |
| 212 | freeform geometry, charts, icons, and ambiguous silhouettes as regular SVG. |
| 213 | See [`references/shared-standards-core.md`](../references/shared-standards-core.md) §1.5 for |
| 214 | the normative contract and |
| 215 | [`references/native-shape-authoring.md`](../references/native-shape-authoring.md) |
| 216 | for selection and authoring guidance. |
| 217 | |
| 218 | PowerPoint-style Merge Shapes materialization (source read-only; result paths |
| 219 | on stdout): |
| 220 | |
| 221 | ```bash |
| 222 | python3 scripts/shape_boolean_svg.py render slide.svg \ |
| 223 | --operation intersect \ |
| 224 | --source circle \ |
| 225 | --source card \ |
| 226 | --id overlap |
| 227 | ``` |
| 228 | |
| 229 | The first source owns result paint and is the primary geometry for `subtract`. |
| 230 | Local and ancestor transforms are baked into SVG-root coordinates. Replace the |
| 231 | operands with every returned path at the root in the primary operand's z-order; |
| 232 | `fragment` returns multiple stable sibling paths. Operands may be supported |
| 233 | closed geometry or supported horizontal implicit-LTR direct `<text>` whose exact |
| 234 | OpenType weight/style can be resolved; repeat `--font-dir PATH` for additional |
| 235 | font roots. Text is shaped to glyph outlines before the operation, so the |
| 236 | result remains editable freeform geometry but is no longer editable text. See |
| 237 | [`references/native-shape-authoring.md`](../references/native-shape-authoring.md) |
| 238 | §6 for the closed operand and failure contract. |
| 239 | |
| 240 | Create-template/source normalization (optional; never part of automatic export): |
| 241 | |
| 242 | ```bash |
| 243 | python3 scripts/extract_svg_assets.py <layered_svg_dir> --icons-dir <icons_dir> --icon-namespace imported --inplace --id-prefix layered |
| 244 | python3 scripts/extract_svg_assets.py <flat_svg_dir> --icons-dir <icons_dir> --icon-namespace imported --reuse-inventory <layered_inventory.json> --inplace --id-prefix flat |
| 245 | python3 scripts/extract_svg_pictures.py "<svg_file>" --select "<group_id>" --resource-root "<workspace>" --images-dir "<picture_assets_dir>" --inplace # optional create-template normalization: one selected group -> one SVG picture |
| 246 | python3 scripts/compact_svg_coordinates.py <template_workspace>/templates --inplace --keep-native-frames |
| 247 | python3 scripts/mirror_template_materialize.py <import_workspace> <empty_template_workspace> # Type A mirror only |
| 248 | ``` |
| 249 | |
| 250 | `extract_svg_assets.py` fingerprints each extracted subtree before generated-ID |
| 251 | namespacing. Process the layered authoring view first, then pass its inventory to |
| 252 | the flat view with `--reuse-inventory`; matching flat subtrees reference the |
| 253 | existing layered asset instead of creating a duplicate file. Only unmatched |
| 254 | flat-only vectors create new assets. Create-template stores these assets once in |
| 255 | `<workspace>/icons/imported/` and writes `data-icon="imported/<name>"` references. |
| 256 | Inventories retain any `data-pptx-source-ref` values carried by the extracted |
| 257 | subtree, so re-inlining preserves authoring-manifest object identity. |
| 258 | Rerunning a namespaced pass against an already rewritten projection inventories |
| 259 | the existing references without progressively wrapping more parent geometry. |
| 260 | |
| 261 | Post-processing and export: |
| 262 | |
| 263 | ```bash |
| 264 | # Run only when the Design Spec's effective Speaker Notes outcome is enabled. |
| 265 | python3 scripts/total_md_split.py <project_path> |
| 266 | python3 scripts/finalize_svg.py <project_path> |
| 267 | python3 scripts/svg_to_pptx.py <project_path> |
| 268 | ``` |
| 269 | |
| 270 | When Speaker Notes is disabled, skip `total_md_split.py` and append |
| 271 | `--no-notes` to `svg_to_pptx.py` so stale files under `notes/` cannot be |
| 272 | embedded. |
| 273 | |
| 274 | `finalize_svg.py` optimizes ordinary raster images by default using `2x` display pixels and max `2560px`; validated nested crop transports retain source pixel dimensions because their inner `1×1` image is source-unit geometry rather than a rendered-pixel budget. Native `svg_to_pptx.py` defaults to `--image-sizing cap`: images that need neither resizing nor EXIF geometry normalization retain their original bytes, while oversized single-frame raster sources are re-encoded after resizing toward `2560px`. Cropped or stretched placements (including imported picture crops) retain enough source pixels to avoid undersupplying the visible frame. Use `svg_to_pptx.py --image-sizing display --image-scale 2 --image-quality 85` for an explicit compact export, or `--no-image-optimize` to force original image bytes. |
| 275 | |
| 276 | `finalize_svg.py` remains mandatory because it creates the self-contained `svg_final/` visual preview. Those SVGs may be opened directly or inserted into PowerPoint as SVG pictures. The only supported generated-PPTX path is `svg_output/` through the project SVG-to-DrawingML converter; `-s final` is diagnostic-only, and PowerPoint's manual Convert-to-Shape operation is unsupported. |
| 277 | |
| 278 | For SVG-authoring routes, `svg_output/` is the complete visible page-design source: every exported text, image, shape, background, and template-derived layout element is present in the page SVG or explicitly referenced by it. Export may translate represented content into Master/Layout/Slide parts or native objects, but it does not retrieve missing visible content from templates or planning files. Speaker notes, animation, narration, transitions, `template-fill-pptx`, and `native-enhance-pptx` remain separately owned capabilities. |
| 279 | |
| 280 | Native `svg_to_pptx.py` release export reads the project's explicit structure mode. Free-design, Brand-only, Style-only, and other `template_reuse_scope: style` projects use `flat`, omit Master/Layout mappings and SVG structure metadata, keep every represented object Slide-local, and materialize one clean project-owned Master plus one Blank Layout from the current color/typography lock. Stock content placeholders and unused built-in Layouts are removed; only the standard date/footer/slide-number capability hooks remain. A Deck/Layout application uses `structured` only when Strategist derives `template_reuse_scope: mirror|layout`: each project supplies unique Master/Layout definitions and one Layout assignment per generated page before SVG generation, and every SVG root repeats its assigned identity. A template-backed definition may remain unused and still register without a published carrier slide. Fixed Master/Layout visuals are direct semantic atoms; ordinary groups are invalid there, while one validated compact authored-preset `<g>` is the sole group exception because it compiles to one native shape. Reusable slots are top-level groups with positive design-zone bounds plus one compatible carrier. Composite `object` regions use explicit proxy binding, and zero-slot Layouts are valid. |
| 281 | |
| 282 | Structured template export compiles only the declared structure, maps locked typography/colors into PowerPoint defaults, creates the named Master/Layout parts, and reads the package back before publication. It never clusters pages, promotes repeated chrome heuristically, or invents placeholders. Flat export is the normal free-design/Brand-only/Style-only/style-scope route: it creates only the clean project-owned shell and performs no promotion or deduplication of Slide content. |
| 283 | |
| 284 | Template `page_layouts` records authoring-input provenance, `pptx_masters` / `pptx_layouts` own unique reusable definitions, and `page_pptx_layouts` owns page assignment. Strict preserves its Master/Layout/slot contract; adaptive retains its Master and may use a new Layout key only when fixed Layout atoms or slot topology/bounds change. `standard` / `fidelity` author new SVGs and a new Master/Layout/slot contract. `mirror` materializes a new workspace from the complete validated source identity graph—including unused Layout definitions—without semantic synthesis or gap filling, while mechanically expanding fixed-layer group wrappers into the direct atoms required by the structured contract. |
| 285 | |
| 286 | Legacy structured/template contracts using `baseline`, `template`, `preserve`, `layout_strategy`, `data-pptx-layout-kind`, `distilled`/`utility`, direct atomic placeholders, or incomplete root Master identity must be replaced by a new workspace created through [`create-template`](../workflows/create-template.md). Generate new structured SVG pages from that workspace; do not upgrade the existing PPTX/SVG in place. Explicit flat free-design/Brand-only/Style-only projects intentionally omit root Master identity. |
| 287 | |
| 288 | `pptx_to_svg.py` annotates verified text-grid tables and conservative chart data with `data-pptx-replace-with` beside the visible SVG fallback and places the payload in `<metadata type="application/json">`; the parent claim selects the chart or table schema. Imported table/chart groups under this contract carry `data-pptx-import-source="pptx"`, whether active or fallback-only. Table import covers exact physical row/grid topology, canonical rectangular merges, safe solid/no-fill per-side borders, plain multi-paragraph cells, and a closed run-rich paragraph schema. Each rich run requires `text` and may use only `bold`, `italic`, `underline`, `strike`, `color`, `font_size`, one `font_family`, `lang`, and `alt_lang`. A merge must use the exact `rowSpan` / `gridSpan` / `hMerge` / `vMerge` physical topology with empty merge slaves. Presentation-only source run XML without a non-empty `effectLst` / `effectDag` normalizes; a table-cell run effect disables native replacement and adds a blocking effect diagnostic. Relationship-bearing text, extensions, line breaks, fields, tabs, bullets, broken text topology, unsafe border XML, non-solid fills, and other merge encodings remain fallback-only. For table style `{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}`, the normalized SVG fallback resolves `wholeTbl`, `firstRow`, horizontal banding, theme colors/fonts, and direct cell/run overrides; other built-in/custom style families are not implied. |
| 289 | |
| 290 | Supported parsed column/bar/line/area, pie/doughnut, scatter, and bubble charts without a baked preview receive a deterministic readable fallback marked `data-pptx-fallback-kind="normalized"`. The importer additionally activates verified column/line/area combo charts, canonical OHLC stock charts, area charts with numeric date axes, verified scatter/bubble charts whose two value axes fit the closed `axes.x` / `axes.y` contract, radar charts, safe `of_pie` `serLines`, axis/title/legend normalization, and validated bar/column gap/overlap cases. Combo plots may retain independent primary/secondary category caches and workbook ranges. Both the category/value and XY contracts retain kind/position/visibility/label position/number format/min/max/major unit/reverse/major gridlines for native read-back. Scatter import derives effective `scatter_style` from uniform per-series line/marker/smooth state. The normalized XY fallback consumes only the two major-gridline flags; the C4/C5 additions do not expand the normalized renderer. `gapWidth` is accepted only as an integer in `0..500` and `overlap` only as an integer in `-100..100`; both normalize in native output, while malformed or out-of-range values fail closed. Safe common series paint forms and theme scheme colors are resolved; unknown series paint/style XML outside the explicit normalization boundaries still fails closed. Safe stock series style may pass the structural gate, but stock series, `hiLowLines`, and up-down bar local styling can still normalize under the data-object-first contract. The PowerPoint-native replacement remains allowed to normalize unmodeled no-fill/alpha/line/marker details and reports the route-level loss risk. Chart title/legend/axis titles and supported data-label flags are retained when the current schema can represent them. Fallback-only objects keep rendered SVG content or a baked chart preview and carry `data-pptx-replacement-status`, which validation and `--native-charts-and-tables` export report as a warning. An active marker without a renderer keeps `data-pptx-fallback-kind="placeholder"`; default export keeps the reconstruction-only placeholder and the native Chart/Table opt-in may still reconstruct it. |
| 291 | |
| 292 | The ChartEx importer accepts exactly the validated treemap, sunburst, histogram, pareto, box-whisker, waterfall, and funnel data models. Supported hierarchy/category/value/series/subtotal data round-trips to native output; source style, axes, labels, and binning may normalize. Numeric caches must be non-empty and finite with exact contiguous point topology. This is not arbitrary ChartEx import or presentation fidelity, and the ChartEx native writer still only promises valid payload palette entries rather than full source styling. |
| 293 | |
| 294 | Active imported table/chart markers carry `data-pptx-fallback-sha256`. Visible fallback edits, reachable SVG fragment-definition changes, marker-local reference-target changes, and marker transforms make the baseline stale: the mandatory quality checker warns, default export remains available, and `--native-charts-and-tables` fails instead of discarding the SVG edit. Generated authoring and reusable templates omit import provenance and a static baseline without warning. Hashless legacy imported markers that still carry PPTX import provenance remain convertible with a checker/replacement-route warning. Legacy `data-pptx-native*`, `data-pptx-visual-status`, and `data-pptx-route-status` spellings and the `--native-objects` option remain read-compatible; generated output and canonical commands use the replacement/fallback names and `--native-charts-and-tables`. |
| 295 | |
| 296 | Exporter-canonical classic charts also recover canonical solid series/slice |
| 297 | colors and exact one- or two-paragraph title styling; two paragraphs retain |
| 298 | their `title` / `subtitle` roles. Slide-number fields resolve to the display |
| 299 | number defined by `firstSlideNum`; standalone master/layout SVGs retain their |
| 300 | literal field fallback because they are shared by multiple slides. |
| 301 | |
| 302 | Image generation: |
| 303 | |
| 304 | ```bash |
| 305 | python3 scripts/latex_render.py <project_path> |
| 306 | python3 scripts/latex_render.py <project_path> --providers codecogs,quicklatex,mathpad,wikimedia |
| 307 | python3 scripts/image_gen.py "A modern futuristic workspace" |
| 308 | python3 scripts/image_gen.py --list-backends |
| 309 | python3 scripts/analyze_images.py <project_path>/images |
| 310 | ``` |
| 311 | |
| 312 | Repository update: |
| 313 | |
| 314 | ```bash |
| 315 | python3 scripts/update_repo.py |
| 316 | python3 scripts/update_repo.py --skip-pip |
| 317 | ``` |
| 318 | |
| 319 | ## Recommendations |
| 320 | |
| 321 | - Keep one user-facing entry point per workflow at the top level of `scripts/` |
| 322 | - Move provider-specific or helper internals into subdirectories |
| 323 | - Prefer the unified entry points `project_manager.py`, `finalize_svg.py`, and `image_gen.py` |
| 324 | - Use `svg_output/` for the only supported native PPTX export and `svg_final/` for self-contained SVG visual preview / picture insertion |
| 325 | |
| 326 | ## Related Docs |
| 327 | |
| 328 | - [Conversion Tools](./docs/conversion.md) |
| 329 | - [Project Tools](./docs/project.md) |
| 330 | - [SVG Pipeline Tools](./docs/svg-pipeline.md) |
| 331 | - [PPTX Transition Core](./docs/pptx-transitions.md) |
| 332 | - [Image Tools](./docs/image.md) |
| 333 | - [Troubleshooting](./docs/troubleshooting.md) |
| 334 | - [Skill Entry](../SKILL.md) |
| 335 | |
| 336 | _Last updated: 2026-07-11_ |
| 337 |