Skip to content

Commit 9eedf39

Browse files
authored
docs(examples): publish the PPTX twins in the showcase (#443)
* docs(examples): add PDF→PPTX twins for the business, financial, and master reports The 2.1 PPTX backend shipped with one bespoke twin-output hero and the Engine Deck PPTX. Add editable-PowerPoint twins for three real document examples so the "one source, two formats" story spans everyday business documents: BusinessReportPptxExample, FinancialReportPptxExample, and MasterShowcasePptxExample each reuse their source example's composition and emit the deck via buildPptx(). Extract a shared document(Path) session factory and a compose(DocumentSession) method on BusinessReportExample and MasterShowcaseExample (FinancialReport already had compose()), so the PDF generate() and the PPTX twin build from an identical session config kept in one place. The report bodies are unchanged — the large line counts on those two files are the method-extraction re-indent (review with git diff -w). FlagshipPptxTwinNativeShapeTest opens each rendered deck with Apache POI and asserts native shapes dominate with only the genuinely un-vectorizable regions rasterising (a clip-masked composite, a photo, two barcodes). The twins are registered in GenerateAllExamples (exercised by the generate-every-example smoke test) and linked from the examples gallery with committed .pptx previews. * docs(examples): publish the PPTX twins in the showcase The showcase could not surface a deck at all. ShowcaseSync selected artifacts with endsWith(".pdf") and a manifest entry carried a single `pdf` field, so the flagships that render both formats advertised only half their output — on the release that makes PowerPoint output the headline. Teach the sync to pick up a same-named .pptx sitting beside a PDF, publish it under web/showcase/pptx/, and carry it as an optional `pptx` field. The card gains a Get PPTX action only when the example actually rendered one, so the 82 PDF-only cards are untouched rather than carrying a dead link. The deck reuses the PDF's thumbnail: both backends draw the same resolved layout, so a separate render would be the same picture, and POI has no page rasterizer to make one. Five flagships now ship both formats — business-report, engine-deck, financial-report, master-showcase and twin-output, the last of which had no showcase card at all until now. maven-banner renders a deck with no PDF sibling; cards are PDF-driven and there is nothing to build its preview from, so it stays out. Fix a duplicate tag chip while regenerating: every entry passes its group as a tag and withCategory prepends the same value, so 37 cards rendered the chip twice. Deduplicating inside withCategory covers all of them and cannot be reintroduced from a call site. The three new twin examples came from a branch predating the removal of the no-arg buildPptx(); they now name their destination like every other example. Verified: full reactor clean verify green (1522 tests, 0 failures). Checked in the running site — 5 of 87 cards carry the action, PDF-only cards show exactly View PDF + View Code, the deck serves 200 with the OOXML content type and a PK signature, no card renders a duplicate tag, and every manifest path resolves on disk. Regeneration churn (every PDF re-renders with a fresh timestamp, 24 PNGs re-encode) is deliberately left out; the release cut regenerates it wholesale.
1 parent 9fbf76d commit 9eedf39

23 files changed

Lines changed: 859 additions & 505 deletions
42.3 KB
Binary file not shown.
402 KB
Binary file not shown.
49.1 KB
Binary file not shown.

examples/README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ are with the canonical DSL, then jump to its detailed section below.
119119
| [Word export (DOCX)](#word-export-docx) | `DocxSemanticBackend` — the same session renders a fixed-layout PDF and an editable Word file; paragraphs / lists / tables / images map 1:1, charts fall back to their data table | [PDF](../assets/readme/examples/word-export-companion.pdf) · [DOCX](../assets/readme/examples/word-export-companion.docx) · [Source](src/main/java/com/demcha/examples/features/docx/WordExportExample.java) |
120120
| [Layout snapshot regression](#layout-snapshot-regression) | Deterministic `layoutSnapshot()` workflow with baseline + drift report — production regression-testing pattern | [PDF](../assets/readme/examples/invoice-snapshot-regression.pdf) · [Source](src/main/java/com/demcha/examples/features/snapshots/LayoutSnapshotRegressionExample.java) |
121121
| [Debug overlay](#debug-overlay) | `DocumentDebugOptions` — guide lines + semantic node-path labels on the sheet; trace any misplaced block back to the builder call that authored it | [PDF](../assets/readme/examples/debug-overlay.pdf) · [Source](src/main/java/com/demcha/examples/features/debug/DebugOverlayExample.java) |
122-
| [Business report cover](#business-report-cover) | Single-page Q1 investor brief — hero image, KPI cards, bar chart, metrics table | [PDF](../assets/readme/examples/business-report.pdf) · [Source](src/main/java/com/demcha/examples/flagships/BusinessReportExample.java) |
123-
| Financial report one-pager | Single-page monthly financial dashboard — three margin gauges, cash & stacked-OPEX charts, a revenue donut, and forecast bars; all v1.8 native vector charts plus inline sparklines and a path-clipped photo masthead | [PDF](../assets/readme/examples/financial-report.pdf) · [Source](src/main/java/com/demcha/examples/flagships/FinancialReportExample.java) |
124-
| [Master showcase](#master-showcase) | Kitchen-sink "Q2 sample report" combining the canonical surface end-to-end | [PDF](../assets/readme/examples/master-showcase.pdf) · [Source](src/main/java/com/demcha/examples/flagships/MasterShowcaseExample.java) |
122+
| [Business report cover](#business-report-cover) | Single-page Q1 investor brief — hero image, KPI cards, bar chart, metrics table; the same composition also renders as an editable PowerPoint deck (KPI cards, chart, and table stay native shapes) via `buildPptx()` | [PDF](../assets/readme/examples/business-report.pdf) · [PPTX](../assets/readme/examples/business-report.pptx) · [Source](src/main/java/com/demcha/examples/flagships/BusinessReportExample.java) · [PPTX source](src/main/java/com/demcha/examples/flagships/BusinessReportPptxExample.java) |
123+
| Financial report one-pager | Single-page monthly financial dashboard — three margin gauges, cash & stacked-OPEX charts, a revenue donut, and forecast bars; all v1.8 native vector charts plus inline sparklines and a path-clipped photo masthead; the same composition also renders as an editable PowerPoint deck via `buildPptx()` | [PDF](../assets/readme/examples/financial-report.pdf) · [PPTX](../assets/readme/examples/financial-report.pptx) · [Source](src/main/java/com/demcha/examples/flagships/FinancialReportExample.java) · [PPTX source](src/main/java/com/demcha/examples/flagships/FinancialReportPptxExample.java) |
124+
| [Master showcase](#master-showcase) | Kitchen-sink "Q2 sample report" combining the canonical surface end-to-end; the same composition also renders as a multi-slide editable PowerPoint deck via `buildPptx()` | [PDF](../assets/readme/examples/master-showcase.pdf) · [PPTX](../assets/readme/examples/master-showcase.pptx) · [Source](src/main/java/com/demcha/examples/flagships/MasterShowcaseExample.java) · [PPTX source](src/main/java/com/demcha/examples/flagships/MasterShowcasePptxExample.java) |
125125
| Feature catalog | Browsable reference PDF: every shipped capability as a block — outline-clickable heading, the exact API call, the rendered result right under it | [PDF](../assets/readme/examples/feature-catalog.pdf) · [Source](src/main/java/com/demcha/examples/flagships/FeatureCatalogExample.java) |
126126
| Book template | A full novel front: full-bleed wave cover, a clickable dotted-leader table of contents with live page numbers, and chapters — the v1.9 book primitives (`pageMargins`, `addTableOfContents`, `DocumentPageNumbering`, container `bookmark`, `viewerPreferences`) in **one session**, no external PDF merge | [PDF](../assets/readme/examples/book-template.pdf) · [Source](src/main/java/com/demcha/examples/features/title/BookTemplateExample.java) |
127127

@@ -1104,8 +1104,12 @@ strategic-highlights bullet list paired with a five-quarter Revenue /
11041104
Profit bar chart, YoY metrics table, and a confidential / page-number
11051105
footer. Use this as the visual reference for landing-page hero shots.
11061106

1107+
The same composition also emits an editable PowerPoint deck (`BusinessReportPptxExample` — one page, one slide; KPI cards, the native chart, and the metrics table stay editable shapes).
1108+
11071109
[📄 View PDF](../assets/readme/examples/business-report.pdf) ·
1108-
[📜 Full source](src/main/java/com/demcha/examples/flagships/BusinessReportExample.java)
1110+
[🖥 View PPTX](../assets/readme/examples/business-report.pptx) ·
1111+
[📜 Full source](src/main/java/com/demcha/examples/flagships/BusinessReportExample.java) ·
1112+
[📜 PPTX twin](src/main/java/com/demcha/examples/flagships/BusinessReportPptxExample.java)
11091113

11101114
### Master showcase
11111115

@@ -1115,8 +1119,12 @@ shape container + branded QR + executive summary + zebra-striped
11151119
totals table + accent-bordered highlight cards + Code 128 footer
11161120
barcode. Reference it when composing your own multi-page documents.
11171121

1122+
The same composition also emits an editable PowerPoint deck (`MasterShowcasePptxExample` — each page becomes one slide; rich text, the advanced table, and chrome stay native shapes, and only the rotated clip-masked seal and the barcodes rasterise).
1123+
11181124
[📄 View PDF](../assets/readme/examples/master-showcase.pdf) ·
1119-
[📜 Full source](src/main/java/com/demcha/examples/flagships/MasterShowcaseExample.java)
1125+
[🖥 View PPTX](../assets/readme/examples/master-showcase.pptx) ·
1126+
[📜 Full source](src/main/java/com/demcha/examples/flagships/MasterShowcaseExample.java) ·
1127+
[📜 PPTX twin](src/main/java/com/demcha/examples/flagships/MasterShowcasePptxExample.java)
11201128

11211129
---
11221130

examples/src/main/java/com/demcha/examples/GenerateAllExamples.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,14 @@
4444
import com.demcha.examples.features.title.PoetryTitlePageExample;
4545
import com.demcha.examples.features.transforms.TransformsExample;
4646
import com.demcha.examples.flagships.BusinessReportExample;
47+
import com.demcha.examples.flagships.BusinessReportPptxExample;
4748
import com.demcha.examples.flagships.EngineDeckExample;
4849
import com.demcha.examples.flagships.EngineDeckPptxExample;
4950
import com.demcha.examples.flagships.FeatureCatalogExample;
5051
import com.demcha.examples.flagships.FinancialReportExample;
52+
import com.demcha.examples.flagships.FinancialReportPptxExample;
5153
import com.demcha.examples.flagships.MasterShowcaseExample;
54+
import com.demcha.examples.flagships.MasterShowcasePptxExample;
5255
import com.demcha.examples.flagships.MavenBannerPptxExample;
5356
import com.demcha.examples.flagships.ModuleFirstFileExample;
5457
import com.demcha.examples.flagships.TwinOutputExample;
@@ -212,13 +215,16 @@ public static void main(String[] args) throws Exception {
212215
// === Flagships ===
213216
System.out.println("Generated: " + ModuleFirstFileExample.generate());
214217
System.out.println("Generated: " + MasterShowcaseExample.generate());
218+
System.out.println("Generated: " + MasterShowcasePptxExample.generate());
215219
System.out.println("Generated: " + FeatureCatalogExample.generate());
216220
System.out.println("Generated: " + BusinessReportExample.generate());
221+
System.out.println("Generated: " + BusinessReportPptxExample.generate());
217222
System.out.println("Generated: " + EngineDeckExample.generate());
218223
System.out.println("Generated: " + EngineDeckPptxExample.generate());
219224
System.out.println("Generated: " + MavenBannerPptxExample.generate());
220225
System.out.println("Generated: " + TwinOutputExample.generate());
221226
System.out.println("Generated: " + FinancialReportExample.generate());
227+
System.out.println("Generated: " + FinancialReportPptxExample.generate());
222228
System.out.println("Generated: " + BookTemplateExample.generate());
223229
System.out.println("Generated: " + PoetryTitlePageExample.generate());
224230
}

0 commit comments

Comments
 (0)