Skip to content

AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He

feat(svg_to_pptx): auto-split source per product; sync docs

hugohe33037145adee0
diff --git a/AGENTS.md b/AGENTS.md
index 49d150cf..183912e9 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -56,7 +56,7 @@ python3 skills/ppt-master/scripts/svg_quality_checker.py <project_path>
# Post-processing pipeline: run sequentially, one command at a time
python3 skills/ppt-master/scripts/total_md_split.py <project_path>
python3 skills/ppt-master/scripts/finalize_svg.py <project_path>
-python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> -s final
+python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path>
```
## Core Directories
diff --git a/CLAUDE.md b/CLAUDE.md
index 5fe2ab6f..ac8e0beb 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -55,7 +55,7 @@ python3 skills/ppt-master/scripts/svg_quality_checker.py <project_path>
# Post-processing pipeline: run sequentially, one command at a time
python3 skills/ppt-master/scripts/total_md_split.py <project_path>
python3 skills/ppt-master/scripts/finalize_svg.py <project_path>
-python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> -s final
+python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path>
```
## Architecture
diff --git a/docs/audio-narration.md b/docs/audio-narration.md
index 6831a227..de016099 100644
--- a/docs/audio-narration.md
+++ b/docs/audio-narration.md
@@ -80,7 +80,7 @@ python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \
--cosyvoice-model cosyvoice-v3-flash
# 3. (Optional) Re-export PPTX with audio embedded
-python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> -s final \
+python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> \
--recorded-narration audio
```
diff --git a/docs/zh/audio-narration.md b/docs/zh/audio-narration.md
index 801266b0..6890e7af 100644
--- a/docs/zh/audio-narration.md
+++ b/docs/zh/audio-narration.md
@@ -73,7 +73,7 @@ python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \
--cosyvoice-model cosyvoice-v3-flash
# 3.(可选)重新导出 PPTX 嵌入音频
-python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> -s final \
+python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> \
--recorded-narration audio
```
diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.md
index 9e2b396a..055aa55b 100644
--- a/skills/ppt-master/SKILL.md
+++ b/skills/ppt-master/SKILL.md
@@ -312,13 +312,21 @@ python3 ${SKILL_DIR}/scripts/finalize_svg.py <project_path>
**Step 7.3** — Export PPTX (embeds speaker notes by default):
```bash
-python3 ${SKILL_DIR}/scripts/svg_to_pptx.py <project_path> -s final
+python3 ${SKILL_DIR}/scripts/svg_to_pptx.py <project_path>
# Output:
-# exports/<project_name>_<timestamp>.pptx ← main native pptx
-# backup/<timestamp>/<project_name>_svg.pptx ← SVG snapshot
+# exports/<project_name>_<timestamp>.pptx ← main native pptx (reads svg_output/, high fidelity)
+# backup/<timestamp>/<project_name>_svg.pptx ← SVG preview pptx (reads svg_final/)
# backup/<timestamp>/svg_output/ ← Executor SVG source backup
```
+> The two products now read from different sources by design: native pptx
+> consumes `svg_output/` so the converter can preserve high-fidelity primitives
+> (icon `<use>` placeholders, image `preserveAspectRatio` → `srcRect`, rounded
+> rect `rx/ry` → `prstGeom roundRect`). The legacy/preview pptx still consumes
+> `svg_final/` because PowerPoint's internal SVG parser cannot handle those
+> primitives. Pass `-s output` or `-s final` to force a single source on both
+> products if you need the older single-source behaviour.
+
**Optional animation flags** (the defaults already enable rich entrance animations — adjust only when the user asks for something different):
- `-t <effect>` — page transition. Default `fade`. Options: `fade` / `push` / `wipe` / `split` / `strips` / `cover` / `random` / `none`.
- `-a <effect>` — per-element entrance animation. Default `mixed` (auto-vary across the deck). Pass `none` to disable, or pick a specific effect like `fade`. Requires top-level `<g id="...">` groups (already required by Executor).
@@ -334,7 +342,7 @@ Do NOT call `notes_to_audio.py` directly without going through the workflow —
Full effect list, anchor logic, and limits: [`references/animations.md`](references/animations.md).
> ❌ **NEVER** substitute `cp` for `finalize_svg.py` — finalize performs multiple critical processing steps
-> ❌ **NEVER** export from `svg_output/` — MUST use `-s final` (exports from `svg_final/`)
+> ❌ **NEVER** force `-s output` for the legacy/preview pptx (PowerPoint's internal SVG parser drops icons and rounded corners). The default auto-split already gives native the high-fidelity source it needs without touching legacy.
> ❌ **NEVER** use `--only` (it suppresses one of the two output files)
> Post-export iteration: whenever the user asks to change anything on a generated slide ("改一下", "调字号", "那里看着不对", "把图片换大点"), the [`visual-edit`](workflows/visual-edit.md) workflow is available — surface it as an option. If the user describes the change with enough specificity to apply directly ("第 3 页副标题字号改 32"), edit the SVG directly instead; if they're vaguely pointing at "somewhere" on the deck, run the workflow.
diff --git a/skills/ppt-master/references/executor-base.md b/skills/ppt-master/references/executor-base.md
index ed6c03d1..8fc9f13c 100644
--- a/skills/ppt-master/references/executor-base.md
+++ b/skills/ppt-master/references/executor-base.md
@@ -334,7 +334,7 @@ python3 scripts/total_md_split.py <project_path>
python3 scripts/finalize_svg.py <project_path>
# 3. Export PPTX
-python3 scripts/svg_to_pptx.py <project_path> -s final
+python3 scripts/svg_to_pptx.py <project_path>
# Output:
# exports/<project_name>_<timestamp>.pptx ← main native pptx
# backup/<timestamp>/<project_name>_svg.pptx ← SVG snapshot
diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.md
index b2ec2571..c70eb684 100644
--- a/skills/ppt-master/references/shared-standards.md
+++ b/skills/ppt-master/references/shared-standards.md
@@ -301,7 +301,7 @@ python3 scripts/total_md_split.py <project_path>
python3 scripts/finalize_svg.py <project_path>
# 3. Export PPTX (from svg_final/, embeds speaker notes by default)
-python3 scripts/svg_to_pptx.py <project_path> -s final
+python3 scripts/svg_to_pptx.py <project_path>
# Output:
# exports/<project_name>_<timestamp>.pptx ← main native pptx
# backup/<timestamp>/<project_name>_svg.pptx ← SVG snapshot
@@ -318,7 +318,7 @@ python3 scripts/svg_to_pptx.py <project_path> -s final
```bash
python3 scripts/notes_to_audio.py <project_path> --voice zh-CN-XiaoxiaoNeural
-python3 scripts/svg_to_pptx.py <project_path> -s final --recorded-narration audio
+python3 scripts/svg_to_pptx.py <project_path> --recorded-narration audio
```
- `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.
@@ -328,9 +328,11 @@ Full reference: [`animations.md`](animations.md).
**Prohibited**:
- NEVER use `cp` as a substitute for `finalize_svg.py`
-- NEVER export directly from `svg_output/` — MUST export from `svg_final/` (use `-s final`)
+- 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.
- NEVER use `--only` (it suppresses one of the two output files)
+> Source-directory split: by default `svg_to_pptx.py` reads `svg_output/` for the native pptx (preserves icon `<use>`, image `preserveAspectRatio` → `srcRect`, 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.
+
**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.
---
diff --git a/skills/ppt-master/references/svg-image-embedding.md b/skills/ppt-master/references/svg-image-embedding.md
index 5c637da7..ea5344b0 100644
--- a/skills/ppt-master/references/svg-image-embedding.md
+++ b/skills/ppt-master/references/svg-image-embedding.md
@@ -125,7 +125,7 @@ Use the unified pipeline in [shared-standards.md §5](shared-standards.md). `fin
```bash
python3 scripts/finalize_svg.py <project_path>
-python3 scripts/svg_to_pptx.py <project_path> -s final
+python3 scripts/svg_to_pptx.py <project_path>
```
### Standalone: embed_images.py (advanced)
diff --git a/skills/ppt-master/scripts/README.md b/skills/ppt-master/scripts/README.md
index 7e06a6ec..ca37c796 100644
--- a/skills/ppt-master/scripts/README.md
+++ b/skills/ppt-master/scripts/README.md
@@ -26,7 +26,7 @@ python3 scripts/project_manager.py init <project_name> --format ppt169
python3 scripts/project_manager.py import-sources <project_path> <source_files...> --move
python3 scripts/total_md_split.py <project_path>
python3 scripts/finalize_svg.py <project_path>
-python3 scripts/svg_to_pptx.py <project_path> -s final
+python3 scripts/svg_to_pptx.py <project_path>
```
Repository update:
@@ -79,7 +79,7 @@ Post-processing and export:
```bash
python3 scripts/total_md_split.py <project_path>
python3 scripts/finalize_svg.py <project_path>
-python3 scripts/svg_to_pptx.py <project_path> -s final
+python3 scripts/svg_to_pptx.py <project_path>
```
Image generation:
diff --git a/skills/ppt-master/scripts/docs/svg-pipeline.md b/skills/ppt-master/scripts/docs/svg-pipeline.md
index 4c221831..e8ca89df 100644
--- a/skills/ppt-master/scripts/docs/svg-pipeline.md
+++ b/skills/ppt-master/scripts/docs/svg-pipeline.md
@@ -9,7 +9,7 @@ Run these steps in order:
```bash
python3 scripts/total_md_split.py <project_path>
python3 scripts/finalize_svg.py <project_path>
-python3 scripts/svg_to_pptx.py <project_path> -s final
+python3 scripts/svg_to_pptx.py <project_path>
```
## `finalize_svg.py`
@@ -29,15 +29,15 @@ It aggregates:
Convert project SVGs into PPTX.
```bash
-python3 scripts/svg_to_pptx.py <project_path> -s final
-python3 scripts/svg_to_pptx.py <project_path> -s final --only native
-python3 scripts/svg_to_pptx.py <project_path> -s final --only legacy
-python3 scripts/svg_to_pptx.py <project_path> -s final --no-notes
+python3 scripts/svg_to_pptx.py <project_path>
+python3 scripts/svg_to_pptx.py <project_path> --only native
+python3 scripts/svg_to_pptx.py <project_path> --only legacy
+python3 scripts/svg_to_pptx.py <project_path> --no-notes
python3 scripts/svg_to_pptx.py <project_path> -t none
-python3 scripts/svg_to_pptx.py <project_path> -s final --auto-advance 3
-python3 scripts/svg_to_pptx.py <project_path> -s final --animation mixed --animation-duration 0.8
+python3 scripts/svg_to_pptx.py <project_path> --auto-advance 3
+python3 scripts/svg_to_pptx.py <project_path> --animation mixed --animation-duration 0.8
python3 scripts/notes_to_audio.py <project_path> --voice zh-CN-XiaoxiaoNeural
-python3 scripts/svg_to_pptx.py <project_path> -s final --recorded-narration audio
+python3 scripts/svg_to_pptx.py <project_path> --recorded-narration audio
```
Behavior:
diff --git a/skills/ppt-master/scripts/docs/troubleshooting.md b/skills/ppt-master/scripts/docs/troubleshooting.md
index d06ce174..9ce486d2 100644
--- a/skills/ppt-master/scripts/docs/troubleshooting.md
+++ b/skills/ppt-master/scripts/docs/troubleshooting.md
@@ -41,7 +41,7 @@ Preferred sequence:
```bash
python3 scripts/total_md_split.py <project_path>
python3 scripts/finalize_svg.py <project_path>
-python3 scripts/svg_to_pptx.py <project_path> -s final
+python3 scripts/svg_to_pptx.py <project_path>
```
Do not export directly from `svg_output/` when `svg_final/` exists.
@@ -53,7 +53,7 @@ Do not export directly from `svg_output/` when `svg_final/` exists.
```bash
python3 scripts/notes_to_audio.py <project_path> --voice zh-CN-XiaoxiaoNeural
-python3 scripts/svg_to_pptx.py <project_path> -s final --recorded-narration audio
+python3 scripts/svg_to_pptx.py <project_path> --recorded-narration audio
```
If slide timings do not follow the narration, confirm `ffprobe` is available; without it, audio can still embed, but duration-based auto-advance is skipped.
diff --git a/skills/ppt-master/scripts/svg_to_pptx/pptx_cli.py b/skills/ppt-master/scripts/svg_to_pptx/pptx_cli.py
index f5f94b52..e6a6380d 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/pptx_cli.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/pptx_cli.py
@@ -92,8 +92,12 @@ Recorded narration:
parser.add_argument('project_path', type=str, help='Project directory path')
parser.add_argument('-o', '--output', type=str, default=None, help='Output file path')
- parser.add_argument('-s', '--source', type=str, default='output',
- help='SVG source: output/final or any subdirectory name (recommended: final)')
+ parser.add_argument('-s', '--source', type=str, default=None,
+ help='SVG source directory. Default: native reads '
+ 'svg_output/ (high-fidelity, preserves icons / '
+ 'preserveAspectRatio / rx-ry); legacy reads '
+ 'svg_final/ (PPT-internal SVG parser fallback). '
+ 'Pass output/final/<name> to force one source.')
parser.add_argument('-f', '--format', type=str,
choices=list(CANVAS_FORMATS.keys()), default=None,
help='Specify canvas format')
@@ -163,12 +167,6 @@ Recorded narration:
if canvas_format is None and detected_format and detected_format != 'unknown':
canvas_format = detected_format
- svg_files, source_dir_name = find_svg_files(project_path, args.source)
-
- if not svg_files:
- print("Error: No SVG files found")
- sys.exit(1)
-
# Determine which versions to generate
only_mode = args.only
gen_native = only_mode in (None, 'native')
@@ -178,6 +176,34 @@ Recorded narration:
if args.native and only_mode is None:
gen_legacy = False
+ # Pipeline split: native pptx gets the high-fidelity svg_output/ source
+ # (icons, preserveAspectRatio, rounded-rect rx/ry are all preserved by the
+ # converter); legacy pptx still needs svg_final/ because PowerPoint's
+ # internal SVG parser cannot handle <use data-icon> or honour
+ # preserveAspectRatio. An explicit -s overrides both branches so callers
+ # can keep the previous single-source behaviour for unusual workflows.
+ explicit_source = args.source is not None
+ native_source = args.source if explicit_source else 'output'
+ legacy_source = args.source if explicit_source else 'final'
+
+ native_files: list[Path] = []
+ legacy_files: list[Path] = []
+ native_source_dir = ''
+ legacy_source_dir = ''
+
+ if gen_native:
+ native_files, native_source_dir = find_svg_files(project_path, native_source)
+ if gen_legacy:
+ legacy_files, legacy_source_dir = find_svg_files(project_path, legacy_source)
+
+ # Reference list for cross-product lookups (notes / narration matching).
+ # native_files and legacy_files share filenames because svg_final/ is
+ # copytree'd from svg_output/, so either list works for matching.
+ ref_files = native_files or legacy_files
+ if not ref_files:
+ print("Error: No SVG files found")
+ sys.exit(1)
+
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
backup_dir: Path | None = None
@@ -203,7 +229,7 @@ Recorded narration:
enable_notes = not args.no_notes
notes: dict[str, str] = {}
if enable_notes:
- notes = find_notes_files(project_path, svg_files)
+ notes = find_notes_files(project_path, ref_files)
narration_audio: dict[str, Path] = {}
narration_audio_dir_arg = args.recorded_narration or args.narration_audio_dir
@@ -212,16 +238,17 @@ Recorded narration:
narration_audio_dir = Path(narration_audio_dir_arg)
if not narration_audio_dir.is_absolute():
narration_audio_dir = project_path / narration_audio_dir
- narration_audio = find_narration_files(narration_audio_dir, svg_files)
+ narration_audio = find_narration_files(narration_audio_dir, ref_files)
if verbose:
print(f" Narration audio directory: {narration_audio_dir}")
- print(f" Narration audio matched: {len(narration_audio)}/{len(svg_files)} slide(s)")
+ print(f" Narration audio matched: {len(narration_audio)}/{len(ref_files)} slide(s)")
transition = args.transition if args.transition != 'none' else None
animation = args.animation if args.animation != 'none' else None
+ # svg_files is per-product (native vs legacy may now read different
+ # directories); everything else is shared.
shared_kwargs = dict(
- svg_files=svg_files,
canvas_format=canvas_format,
verbose=verbose,
transition=transition,
@@ -247,13 +274,14 @@ Recorded narration:
print("PPT Master - SVG to PPTX Tool")
print("=" * 50)
print(f" Project path: {project_path}")
- print(f" SVG directory: {source_dir_name}")
+ print(f" SVG directory: {native_source_dir}")
print(f" Output file: {native_path}")
print()
ok = create_pptx_with_native_svg(
output_path=native_path,
use_native_shapes=True,
+ svg_files=native_files,
**shared_kwargs,
)
success = success and ok
@@ -267,13 +295,14 @@ Recorded narration:
print("PPT Master - SVG to PPTX Tool (SVG Reference)")
print("=" * 50)
print(f" Project path: {project_path}")
- print(f" SVG directory: {source_dir_name}")
+ print(f" SVG directory: {legacy_source_dir}")
print(f" Output file: {legacy_path}")
print()
ok = create_pptx_with_native_svg(
output_path=legacy_path,
use_native_shapes=False,
+ svg_files=legacy_files,
**shared_kwargs,
)
success = success and ok
diff --git a/skills/ppt-master/workflows/generate-audio.md b/skills/ppt-master/workflows/generate-audio.md
index 646a6f2c..04257ce2 100644
--- a/skills/ppt-master/workflows/generate-audio.md
+++ b/skills/ppt-master/workflows/generate-audio.md
@@ -139,7 +139,7 @@ python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \
--cosyvoice-model cosyvoice-v3-flash
# 2. (If user kept embedding) Re-export PPTX with audio embedded
-python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> -s final \
+python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> \
--recorded-narration audio
```
@@ -154,4 +154,4 @@ Output one summary block listing:
- Number of audio files generated and their location (`<project_path>/audio/*`).
- The provider, voice, and rate/settings actually used.
- (If embedded) the new narrated PPTX path under `<project_path>/exports/`.
-- (If skipped embedding) one-line hint on how to embed later: `python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> -s final --recorded-narration audio`.
+- (If skipped embedding) one-line hint on how to embed later: `python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> --recorded-narration audio`.
diff --git a/skills/ppt-master/workflows/verify-charts.md b/skills/ppt-master/workflows/verify-charts.md
index 3ad71233..e9ace07e 100644
--- a/skills/ppt-master/workflows/verify-charts.md
+++ b/skills/ppt-master/workflows/verify-charts.md
@@ -150,5 +150,5 @@ Continue with post-processing & export ([SKILL.md Step 7](../SKILL.md)):
```bash
python3 skills/ppt-master/scripts/total_md_split.py <project_path>
python3 skills/ppt-master/scripts/finalize_svg.py <project_path>
-python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> -s final
+python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path>
```
diff --git a/skills/ppt-master/workflows/visual-edit.md b/skills/ppt-master/workflows/visual-edit.md
index 20fc767c..4a9c594e 100644
--- a/skills/ppt-master/workflows/visual-edit.md
+++ b/skills/ppt-master/workflows/visual-edit.md
@@ -56,7 +56,7 @@ Triggered when the user signals (in any wording) that they have submitted annota
5. Re-run post-processing:
```bash
python3 ${SKILL_DIR}/scripts/finalize_svg.py <project_path>
- python3 ${SKILL_DIR}/scripts/svg_to_pptx.py <project_path> -s final
+ python3 ${SKILL_DIR}/scripts/svg_to_pptx.py <project_path>
```
6. Restart the editor (same command as Step 1).
7. Tell the user (in their language) that annotations have been applied, the PPT is updated, and the editor is running again at `http://localhost:5050`.