Skip to content

docs(examples): the catalogue stops calling current code legacy - #497

Merged
DemchaAV merged 1 commit into
developfrom
docs/examples-entry-path
Aug 3, 2026
Merged

docs(examples): the catalogue stops calling current code legacy#497
DemchaAV merged 1 commit into
developfrom
docs/examples-entry-path

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Why

Two entries in the example gallery sat under this heading:

🗄️ Legacy — pre-rebuild examples kept for downstream callers still on V1; do not start new code here. See docs/templates/which-template-system.md for the V1 → V2 migration path.

There is no V1. docs/templates/which-template-system.md says in its second sentence that GraphCompose 2.0 ships no other template system, both examples compile against 2.1.1-SNAPSHOT on the current DSL, and three hundred lines below the same file describes one of them as a "useful starting point when your domain doesn't fit any built-in template". A reader looking for exactly that — hand-composed, no preset — was told not to start there.

Separately, the run instructions led with GenerateAllExamples. That is not a cheap first command: it is a hand-written list of a hundred generate() calls preceded by ExampleOutputPaths.clean(), so a reader following the page in order emptied the output directory and rendered the whole catalogue before seeing one document.

What changed

  • The category is now ✍️ Hand-composed — what those examples are — with the V1 wording and the migration link gone from both the legend and the section heading. The #handcrafted-proposal and #weekly-schedule sub-anchors are untouched, so nothing that links into the file breaks.
  • Run instructions reordered: one example first (ModuleFirstFileExample, a Start-here row), then the batch entry point below it, labelled as the way the committed previews and the showcase site get refreshed.
  • Release labels the docs(examples): stop the examples describing the releases they were written for #491 sweep left behind are gone: ## v1.5 feature showcases, "all v1.8 native vector charts", "the v1.9 book primitives", "byte-identical to v1.4", and "v1.5 cinematic features" in the intro. Also XxxTemplateV2, a wrapper name that never existed under that spelling and no longer exists under any.
  • docs/recipes.md: the extension-guide entry no longer dates itself to v1.5, and a 1.x migration guide is dropped from the current cookbook's further-reading list — it remains reachable from the documentation index's Historical documentation section.

What I did not do

The recon for the previous PR noted that four Start-here rows (Engine Showcase, Engine Deck, Twin Output, Maven Central Banner) are bold labels rather than in-page links, unlike the four above them. That is not an oversight: grep '^### ' shows those four examples have no detail section in the file to link to. Giving them anchors means writing four new sections, which is a different change from this one.

Verification

./mvnw -B -ntp clean verifyBUILD SUCCESS, exit 0, 692 tests in the closing module. DocumentationSnippetCompileTest 6 (this file carries 39 java fences, all still marked), CanonicalSurfaceGuardTest 11 (every relative link resolves), DocumentationCoverageTest 5.

grep -n "v1\.[0-9]\|\bV1\b\|Legacy" over examples/README.md returns nothing.

One thing worth an eyeball rather than a test: the new pointer [🚀 Start here](#-start-here) is the only link in the repository to an emoji heading, and no test validates in-page anchors — CanonicalSurfaceGuardTest skips # targets by design. The slug follows github-slugger's rule (emoji stripped, leading space becomes the leading hyphen), but the rendered page is the only place to confirm it.

Lane: docs. No production code, no public API.

Two examples sat under "🗄️ Legacy — pre-rebuild examples kept for downstream
callers still on V1; do not start new code here", with a link to a V1 → V2
migration path. There is no V1. That surface was removed in 2.0 —
docs/templates/which-template-system.md says so in its second sentence —
both examples compile against the current DSL, and three hundred lines
below the same file calls one of them a "useful starting point". The
category is renamed to what those examples actually are: documents
assembled from primitives, with no template behind them.

The run instructions led with GenerateAllExamples, which empties the output
directory and regenerates roughly a hundred documents. A reader following
the page top to bottom paid for the whole catalogue before seeing a single
example. Single-example first now, pointing at the Start-here table for
which one to pick; the batch entry point sits below it, labelled as the way
the committed previews and the showcase site are refreshed.

Also removes the release labels the #491 sweep left behind — "v1.5 feature
showcases", "v1.8 native vector charts", "the v1.9 book primitives",
"byte-identical to v1.4" — and, in the recipe index, a 1.x migration guide
that is still reachable from the documentation index's historical section.

./mvnw -B -ntp clean verify — BUILD SUCCESS, 692 tests in the closing
module.
@DemchaAV
DemchaAV force-pushed the docs/examples-entry-path branch from 7242c90 to 06befc7 Compare August 3, 2026 15:25
@DemchaAV

DemchaAV commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

Both fixed, and both deserved the catch — a PR about instruction accuracy that shipped two inaccurate instructions in the run path is the worst place for them.

1. The class-name rule is now stated and proven. The text gives the derivation explicitly — drop src/main/java/ and .java, swap / for . — with the worked example you suggested. Then I checked it generalises rather than assuming: every one of the ~40 source paths linked from this file declares a package matching its directory (zero mismatches), and each Start-here class has a main. Finally I ran it end to end on a row I had not pasted — derived com.demcha.examples.templates.invoice.InvoiceCinematicFileExample by the rule, ran it, exit 0, Generated: …invoice-cinematic.pdf, one document.

2. GenerateAllExamples publishes nothing — corrected. Verified in the source before rewriting: it writes only into examples/target/generated-pdfs/; ShowcaseSync copies into web/showcase/, renders the PNG thumbnails and rewrites web/examples.json; and Refresh-CommittedPreviews in cut-release.ps1 walks the generated tree and re-copies the already committed subset under assets/readme/examples/. So the batch runner is the source both of those read from, which is what the text says now. The same wrong sentence was in the CHANGELOG entry and is fixed there too.

I left the ShowcaseSync command out of the block: this section is the reader's path to running an example, and that tool is maintainer-side, driven by the cut. Naming it and what it does seemed the right amount. Say the word if you want the command shown too.

./mvnw -B -ntp clean verifyBUILD SUCCESS, 692 tests in the closing module.

Head is now 06befc73.

@DemchaAV
DemchaAV merged commit d0f3e67 into develop Aug 3, 2026
10 checks passed
@DemchaAV
DemchaAV deleted the docs/examples-entry-path branch August 3, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant