Skip to content

feat(examples): auto-render the version-stamped README hero banner on release#260

Merged
DemchaAV merged 2 commits into
developfrom
feat/showcase-banner-autorender
Jun 29, 2026
Merged

feat(examples): auto-render the version-stamped README hero banner on release#260
DemchaAV merged 2 commits into
developfrom
feat/showcase-banner-autorender

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

Why

The README hero (assets/readme/repository_showcase_render.png) showed a
hardcoded version pill — EngineDeckExample carried VERSION = "1.8.0"
constants, and the PNG was rasterised by hand (render to PDF, then
PdfPageRasterizer, then a manual copy), wired into nothing. So it drifted: the
committed hero still read "v1.8.0 illustrative" while the repo was on 1.9.0, and
nothing re-rendered it at release time.

What changed

  • Version single-sourced. New Maven-filtered
    examples/src/main/resources/banner.properties
    (version=@project.version@, codename=navigable); EngineDeckExample loads
    it (with a "dev" fallback for the unfiltered IDE case) instead of the
    hardcoded constants. examples/pom.xml filters only that one resource so
    binary assets stay byte-intact.
  • Rendered via toImage, no PDF round-trip. The new ReadmeBannerRenderer
    writes the PNG straight from EngineDeckExample.renderBannerImage(dpi)
    DocumentSession.toImage(0, dpi). composeBannerInto shares the banner
    composition with the kept PDF generateBanner.
  • Cut triggers it. cut-release.ps1 gains Render-ReadmeBanner (runs after
    Run-ShowcaseSync installs the bumped artifact, before verify) and adds
    assets/readme/repository_showcase_render.png to the Step-6 commit allow-list,
    so the hero re-renders with the just-bumped version and ships in the release
    commit.
  • Guarded. VersionConsistencyGuardTest.readmeBannerVersionDerivesFromProjectVersion
    fails the build if the banner version is hardcoded again;
    ReadmeBannerRendererTest covers the render, the PNG write, and that filtering
    actually resolved.

Verification

./mvnw -B -ntp clean verify -pl .BUILD SUCCESS, 1608 tests, 0 javadoc
warnings
(the +1 is the new guard). ./mvnw -f examples/pom.xml test -Dtest=ReadmeBannerRendererTest3 pass. Filtering confirmed
(target/classes/banner.propertiesversion=1.8.0). A test render's pill
reads "v1.8.0 navigable"; at cut (pom→1.9.0) it becomes "v1.9.0 navigable".
cut-release.ps1 -DryRun confirms the bump → install → render → stage
ordering and the -Dexec.args=<abs path> quoting.

Lane: examples + build/release-tooling — version-stamped hero auto-rendered
on release; no engine or public-API change.

Notes

  • The hero keeps its pageSize(801, 525) crop rather than switching to
    bleed(...): the whole page is the banner (a full-page pageBackground),
    which bleed() — content spilling past a trim edge — does not model. A
    white-page-with-bleeding-band redesign would be a separate visual change.
  • The committed PNG is intentionally not regenerated here (the pom is still
    1.8.0); the cut produces the correct "v1.9.0 navigable" hero. PdfPageRasterizer
    stays as a general PDF→PNG tool.

DemchaAV and others added 2 commits June 29, 2026 07:32
… release

The README hero (assets/readme/repository_showcase_render.png) carried a
hardcoded version constant and was rasterised by hand, so it drifted — it still
read v1.8.0 while the repo was on 1.9.0. Now it is single-sourced and rendered
straight from the engine:

- EngineDeckExample reads its version + codename from a Maven-filtered
  banner.properties (version=@project.version@, codename=navigable) instead of
  hardcoded constants, so the hero always carries the reactor version.
- The new ReadmeBannerRenderer writes the PNG straight from the engine via
  DocumentSession.toImage(0, dpi) — no render-to-PDF-then-PdfPageRasterizer
  round-trip. EngineDeckExample.renderBannerImage shares the banner composition
  with the (kept) PDF generateBanner via composeBannerInto.
- cut-release.ps1 re-renders the banner after the version bump and stages it in
  the release commit (gated under -not -SkipShowcase), so the committed hero
  ships in lockstep with every tag.
- VersionConsistencyGuardTest fails the build if banner.properties stops sourcing
  the version from @project.version@; ReadmeBannerRendererTest covers the render,
  the PNG write, and that filtering actually resolved.

The hero keeps its tight pageSize crop: the whole page is the banner via
pageBackground, which bleed() does not replace.
@DemchaAV DemchaAV merged commit b60bde1 into develop Jun 29, 2026
11 checks passed
@DemchaAV DemchaAV deleted the feat/showcase-banner-autorender branch June 29, 2026 07:34
DemchaAV added a commit that referenced this pull request Jun 29, 2026
* chore(api): close v1.9.0 engine-leak guard and metadata gaps (#253)

* test(api): extend the engine-leak guard to all public document.* packages

PublicApiNoEngineLeakTest pinned only eight document.* packages, while
output, snapshot, theme, exceptions, and emoji are equally public and must
stay free of com.demcha.compose.engine.* imports. Add all five to
PUBLIC_API_ROOTS; each is already engine-clean so the guard passes and
locks the property in. Engine-adjacent internals (layout, backend,
templates, debug) stay excluded by design.

* docs(api): complete v1.9.0 since/deprecation metadata and date-ready CHANGELOG

- DocumentSession.pageMargins(List<PageMarginRule>) gains @SInCE 1.9.0,
  matching its sibling 1.9.0 methods (viewerPreferences, pageIndex, toImage).
- HeadlineRenderer / ContactRenderer / BannerRenderer become
  @deprecated(since = "1.9.0", forRemoval = true) with the @deprecated Javadoc
  leading "since 1.9.0; removed in 2.0.", matching CoverLetterTemplate and the
  api-stability deprecation ledger.
- CHANGELOG in-progress header "v1.9.0 - unreleased" -> "v1.9.0 - Planned" so
  the release tooling rewrites it to the ISO date at cut time.

* docs(readme): announce v1.9.0 "navigable" and add the v1.8->v1.9 migration guide (#254)

- README "Release status" now names v1.9.0 (codename "navigable") as Latest
  stable, and the "What's new" section covers in-document navigation, the
  native TOC / page references / bookmarks, multi-section documents, the
  per-page-margin / bleed / row-layout additions, inline chips / SVG / emoji,
  and render-to-images. Install snippets stay at 1.8.0 (the release tooling
  flips them at cut time).
- Add docs/roadmaps/migration-v1-8-to-v1-9.md — additive-only upgrade guide
  with a per-area TL;DR table, the one negative-margin behaviour note, the
  2.0-bound shim deprecations, and the upgrade snippet.
- Index the v1.8->v1.9 and the previously unlisted v1.7->v1.8 guides in
  docs/README.md.

* docs(examples): gallery entries for inline chips, SVG, emoji, in-PDF navigation (#256)

Four v1.9.0 features visible in a rendered document had no gallery presence.
Add a row + detailed showcase section + a committed preview render for each,
with the API names read off the runnable *Example classes:

- Inline highlight chips (RichText.code / chip / highlight) — Core DSL.
- Inline SVG icons (RichText.svgIcon) — Core DSL.
- Colour emoji by shortcode (RichText.emoji) — Core DSL.
- In-PDF navigation (anchor / linkTo / inlineLinkTo / shapeLinkTo) — Advanced SPI.

The emoji preview uses the 44 KB shortcode showcase; the full emoji-gallery
render is 3.9 MB, too large for a committed README asset.

* deps(deps): bump the maven-minor-patch group across 3 directories with 2 updates (#259)

Bumps the maven-minor-patch group with 2 updates in the / directory: [org.junit:junit-bom](https://github.com/junit-team/junit-framework) and [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback).
Bumps the maven-minor-patch group with 2 updates in the /benchmarks directory: [org.junit:junit-bom](https://github.com/junit-team/junit-framework) and [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback).
Bumps the maven-minor-patch group with 2 updates in the /examples directory: [org.junit:junit-bom](https://github.com/junit-team/junit-framework) and [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback).


Updates `org.junit:junit-bom` from 6.1.0 to 6.1.1
- [Release notes](https://github.com/junit-team/junit-framework/releases)
- [Commits](junit-team/junit-framework@r6.1.0...r6.1.1)

Updates `ch.qos.logback:logback-classic` from 1.5.34 to 1.5.37
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](qos-ch/logback@v_1.5.34...v_1.5.37)

Updates `org.junit:junit-bom` from 6.1.0 to 6.1.1
- [Release notes](https://github.com/junit-team/junit-framework/releases)
- [Commits](junit-team/junit-framework@r6.1.0...r6.1.1)

Updates `ch.qos.logback:logback-classic` from 1.5.34 to 1.5.37
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](qos-ch/logback@v_1.5.34...v_1.5.37)

Updates `org.junit:junit-bom` from 6.1.0 to 6.1.1
- [Release notes](https://github.com/junit-team/junit-framework/releases)
- [Commits](junit-team/junit-framework@r6.1.0...r6.1.1)

Updates `ch.qos.logback:logback-classic` from 1.5.34 to 1.5.37
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](qos-ch/logback@v_1.5.34...v_1.5.37)

---
updated-dependencies:
- dependency-name: org.junit:junit-bom
  dependency-version: 6.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: maven-minor-patch
- dependency-name: ch.qos.logback:logback-classic
  dependency-version: 1.5.37
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: maven-minor-patch
- dependency-name: org.junit:junit-bom
  dependency-version: 6.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: maven-minor-patch
- dependency-name: ch.qos.logback:logback-classic
  dependency-version: 1.5.37
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: maven-minor-patch
- dependency-name: org.junit:junit-bom
  dependency-version: 6.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: maven-minor-patch
- dependency-name: ch.qos.logback:logback-classic
  dependency-version: 1.5.37
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: maven-minor-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ci: bump actions/cache from 5 to 6 in the github-actions group (#258)

Bumps the github-actions group with 1 update: [actions/cache](https://github.com/actions/cache).


Updates `actions/cache` from 5 to 6
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v5...v6)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artem Demchyshyn <132658418+DemchaAV@users.noreply.github.com>

* feat(examples): auto-render the version-stamped README hero banner on release (#260)

The README hero (assets/readme/repository_showcase_render.png) carried a
hardcoded version constant and was rasterised by hand, so it drifted — it still
read v1.8.0 while the repo was on 1.9.0. Now it is single-sourced and rendered
straight from the engine:

- EngineDeckExample reads its version + codename from a Maven-filtered
  banner.properties (version=@project.version@, codename=navigable) instead of
  hardcoded constants, so the hero always carries the reactor version.
- The new ReadmeBannerRenderer writes the PNG straight from the engine via
  DocumentSession.toImage(0, dpi) — no render-to-PDF-then-PdfPageRasterizer
  round-trip. EngineDeckExample.renderBannerImage shares the banner composition
  with the (kept) PDF generateBanner via composeBannerInto.
- cut-release.ps1 re-renders the banner after the version bump and stages it in
  the release commit (gated under -not -SkipShowcase), so the committed hero
  ships in lockstep with every tag.
- VersionConsistencyGuardTest fails the build if banner.properties stops sourcing
  the version from @project.version@; ReadmeBannerRendererTest covers the render,
  the PNG write, and that filtering actually resolved.

The hero keeps its tight pageSize crop: the whole page is the banner via
pageBackground, which bleed() does not replace.

* docs(readme): add the graph-compose-emoji install snippet for the v1.9.0 emoji feature (#261)

The "What's new in v1.9" block names colour emoji via the independently-versioned
graph-compose-emoji module, but the install section gave no coordinate for it —
only the fonts companion artifact had a copy-paste dependency block. Add a
parallel graph-compose-emoji (1.0.0) snippet, noting emoji is opt-in (the bundle
stays fonts-only) and that an unknown shortcode falls back to literal text.

* fix(release-script): recompile examples in the banner step so the hero stamps the bumped version

Render-ReadmeBanner ran `exec:java ReadmeBannerRenderer` without compiling the
examples module. banner.properties is filtered to ${project.version} at
examples-compile time, and the cut never recompiles examples after the Step-1
version bump — so the re-rendered hero carried the PREVIOUS release version
(e.g. a v1.9.0 cut would have stamped "v1.8.0"). Add `compile` to the exec so
the module is rebuilt at the bumped version and banner.properties re-filters
before the render.

* Release v1.9.0

* post-release: flip showcase links back to /blob/develop

* docs: add first-document, capabilities, diagrams, and business-templates guides (#263)

Add four developer-facing pages and wire them into the docs index.

- first-document.md — a five-minute path from an empty project to a
  rendered PDF: the smallest document, a multi-section custom flow, the
  built-in template shortcut, and server streaming.
- capabilities.md — a feature-to-API map giving the main call, the
  stability tier, and a guide link for each capability; the API stability
  policy stays authoritative for the contract.
- diagrams.md — Mermaid decision diagrams for the authoring path, content
  placement, output destination, and document lifecycle.
- templates/business-templates.md — the built-in InvoiceTemplateV2 and
  ProposalTemplateV2 compose-first contract, end to end, including the
  server-stream variant.

getting-started.md gains a one-line pointer to first-document.md, and the
docs README persona table and category index link the new pages.

* ci(deploy-web): drop the v* tag trigger that fails every release (#262)

The GitHub Pages deploy fired on both the main push and the v* release tag, but
the tag run failed every release: Pages refuses to deploy from a tag ref (the
github-pages environment only allows main), so it produced a red X without ever
deploying — and via cancel-in-progress could race-cancel the good main run. The
unconditional `push: branches: [main]` trigger (no paths filter) already covers
releases reliably, so the tag trigger is redundant. Remove it.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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