docs(examples): publish the PPTX twins in the showcase#443
Merged
Conversation
…aster 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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The showcase could not surface a deck at all:
ShowcaseSyncselected artifacts withendsWith(".pdf"), and a manifest entry carried a singlepdffield. So the flagships that render both formats advertised only half their output — on the release where PowerPoint output is the headline.This turned out to be more than the "regenerate the manifest" the release plan assumed. Making a deck visible needed deck discovery, a manifest field, and a card action.
What changed
ShowcaseSyncpicks up a same-named.pptxbeside a PDF, publishes it underweb/showcase/pptx/, and carries it as an optionalpptxfield. 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 rasteriser to make one.Get PPTXaction only when the example actually rendered one, so the 82 PDF-only cards are untouched rather than carrying a dead link.BusinessReportPptxExample,FinancialReportPptxExample,MasterShowcasePptxExample) plusFlagshipPptxTwinNativeShapeTestand their committed.pptxassets. They came from a branch predating the removal of the no-argbuildPptx()and now name their destination like every other example.withCategoryprepends the same value, so 37 cards rendered the chip twice. Deduplicating insidewithCategorycovers all of them and cannot be reintroduced from a call site — a first pass that patched 4 call sites was reverted once the regenerated manifest showed the scale.Five flagships now ship both formats:
business-report,engine-deck,financial-report,master-showcase, andtwin-output— the last of which had no showcase card at all until now.Verified in the running site, not inferred
View PDF+View Code.200,application/vnd.openxmlformats-officedocument.presentationml.presentation, 56 698 bytes,PKsignature.clean verifygreen — 1522 tests, 0 failures.Notes for review
maven-banneris deliberately absent. It renders a deck with no PDF sibling; cards are PDF-driven and there is nothing to build its preview from.engine-deck-v2disappears from the manifest.EngineDeckV2Exampleis not registered inGenerateAllExamples(0 references), so a full run never produces it — the entry was stale, carrying the fallback description "Generated showcase for flagships / default." and acodeURL pointing at the package directory. Not a regression here:cut-release.ps1runs the same two commands, so it would have vanished at the cut. Whether that example should be registered is a separate call.