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(ppt_to_md): transcribe native chart data into Markdown so values survive conversion

hugohe311f88ffb3b21
diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.md
index b3b1f43f..4a344c97 100644
--- a/skills/ppt-master/SKILL.md
+++ b/skills/ppt-master/SKILL.md
@@ -310,6 +310,8 @@ Read references/strategist.md
**`<project_path>/analysis/` is the project's intermediate-analysis folder: the canonical home for machine-extracted source/asset facts — the PPTX intake bundle (`source_profile.json` + `identity.json` + `slide_library.json`) and `image_analysis.csv`. It holds facts, not design contracts — `design_spec.md` / `spec_lock.md` stay at the project root.** The MUST-read contract covers only the **compact structured data files (`.json` / `.csv`)**; other artifacts that may live under `analysis/` (e.g. a beautify `source_svg_import/` vector reference package) are NOT bulk-read — they are read selectively only when a specific workflow step calls for them. Before the Eight Confirmations, Strategist MUST read the auto-extracted fact files already in `analysis/` — currently `source_profile.json` (PPTX intake), when present. Use canvas / chart / table entries as factual source context, and use palette / typography observations as recommendation candidates only unless a standalone workflow (beautify / template-fill) has explicitly promoted them to constraints. (`image_analysis.csv` lands later, at the image-analysis step below, and is the authoritative image-fact source there.)
+**Channel ownership — read each fact once from its owning channel.** In the main pipeline the **content contract is the Markdown** (`sources/<stem>.md`): text, tables, and chart data values all come from there (`ppt_to_md` now transcribes native chart data into Markdown tables). The `analysis/` chart / table entries are a **structural digest** for outline decisions (which slides carried charts, type, series names) — not a second copy of the values; do NOT also pull chart values from `slide_library.json` in the main pipeline. `slide_library.json`'s full structured data is owned by the direct-PPTX workflows: template-fill uses it as the native fill contract; beautify uses it for native chart / table data while keeping slide text from the Markdown.
+
**Eight Confirmations** (full template: `templates/design_spec_reference.md`):
⛔ **BLOCKING**: present the Eight Confirmations as a single bundled recommendation set and **wait for explicit user confirmation or modification** before outputting Design Specification & Content Outline. This is the single core confirmation point — once confirmed, all subsequent steps proceed automatically.
diff --git a/skills/ppt-master/scripts/docs/conversion.md b/skills/ppt-master/scripts/docs/conversion.md
index 6d0cc7e3..5dd8ed60 100644
--- a/skills/ppt-master/scripts/docs/conversion.md
+++ b/skills/ppt-master/scripts/docs/conversion.md
@@ -122,6 +122,7 @@ python3 scripts/source_to_md/ppt_to_md.py template.ppsx -o notes/template.md
Behavior:
- extracts slide text in reading order
- converts PowerPoint tables to Markdown tables
+- transcribes native chart data (type + categories × series values) into a Markdown table, so chart numbers are not lost in conversion
- exports embedded pictures to a sibling `_files/` directory
- appends speaker notes when present
diff --git a/skills/ppt-master/scripts/source_to_md/ppt_to_md.py b/skills/ppt-master/scripts/source_to_md/ppt_to_md.py
index e6844001..64b1e276 100644
--- a/skills/ppt-master/scripts/source_to_md/ppt_to_md.py
+++ b/skills/ppt-master/scripts/source_to_md/ppt_to_md.py
@@ -359,6 +359,76 @@ def table_to_markdown(table: object) -> str:
return "\n".join(lines)
+def _format_chart_value(value: object) -> str:
+ """Render a chart data point, trimming whole-number floats."""
+ if value is None:
+ return ""
+ if isinstance(value, float) and value.is_integer():
+ return str(int(value))
+ return str(value)
+
+
+def chart_to_markdown(chart: object, name: str) -> str:
+ """Render a chart's data as a Markdown table so the numbers survive conversion.
+
+ A native PowerPoint chart stores its data in embedded XML, not in any text
+ frame — emitting only a `[Chart]` placeholder drops every value. The markdown
+ is the content contract for downstream generation, so transcribe categories ×
+ series here. `scripts/pptx_intake.py` writes the same data in structured JSON
+ form for tooling; this is the human- and content-readable mirror.
+ """
+ try:
+ chart_type = str(chart.chart_type)
+ except (ValueError, AttributeError):
+ chart_type = ""
+
+ categories: list[str] = []
+ try:
+ plots = list(chart.plots)
+ if plots:
+ categories = [
+ escape_table_cell(str(cat)) if cat is not None else ""
+ for cat in plots[0].categories
+ ]
+ except (ValueError, IndexError, AttributeError):
+ categories = []
+
+ series_data: list[tuple[str, list[object]]] = []
+ try:
+ for index, series in enumerate(chart.series, start=1):
+ try:
+ values = list(series.values)
+ except (ValueError, TypeError, AttributeError):
+ values = []
+ label = str(series.name) if getattr(series, "name", None) else f"Series {index}"
+ series_data.append((escape_table_cell(label), values))
+ except (ValueError, AttributeError):
+ series_data = []
+
+ header = f"> [Chart] {name}" + (f" — {chart_type}" if chart_type else "")
+ row_count = len(categories) if categories else max((len(v) for _, v in series_data), default=0)
+ if not series_data or row_count == 0:
+ return header
+
+ table_header = (["Category"] if categories else ["#"]) + [sname for sname, _ in series_data]
+ lines = [
+ header,
+ "",
+ "| " + " | ".join(table_header) + " |",
+ "| " + " | ".join(["---"] * len(table_header)) + " |",
+ ]
+ for row_index in range(row_count):
+ if categories:
+ label = categories[row_index] if row_index < len(categories) else ""
+ else:
+ label = str(row_index + 1)
+ cells = [label]
+ for _, values in series_data:
+ cells.append(_format_chart_value(values[row_index]) if row_index < len(values) else "")
+ lines.append("| " + " | ".join(cells) + " |")
+ return "\n".join(lines)
+
+
def _image_part_for_shape(shape: object) -> object | None:
"""Return the first embedded image part referenced by a shape."""
element = getattr(shape, "element", None)
@@ -710,7 +780,10 @@ def convert_presentation_to_markdown(
continue
if getattr(shape, "has_chart", False):
- blocks.append(f"> [Chart] {getattr(shape, 'name', 'Chart')}")
+ try:
+ blocks.append(chart_to_markdown(shape.chart, getattr(shape, "name", "Chart")))
+ except (ValueError, AttributeError, KeyError):
+ blocks.append(f"> [Chart] {getattr(shape, 'name', 'Chart')}")
if blocks:
lines.append("\n\n".join(blocks))