Skip to content

Rebuild examples as a generated symbology gallery - #236

Merged
s2x merged 1 commit into
v2from
feature/examples-gallery
Sep 3, 2026
Merged

Rebuild examples as a generated symbology gallery#236
s2x merged 1 commit into
v2from
feature/examples-gallery

Conversation

@s2x

@s2x s2x commented Sep 3, 2026

Copy link
Copy Markdown
Member

What

Replaces the seven tutorial scripts in examples/ with one generator: php examples/gallery.php, which builds a symbology gallery from whatever the registry supports.

  • examples/index.md — every supported QR/barcode, one row each
  • examples/codes/<symbology>.md — one page per code: payload, capabilities, and every renderer's output (SVG, PNG, HTML div/table, ASCII ×3); a renderer that cannot draw a symbol faithfully says so on the page instead of being skipped
  • examples/assets/ — the image files the pages point at

The list of symbologies and renderers comes from the registry, so nothing in the generator hardcodes "every" — a symbology added to Defaults appears in the gallery without this file changing.

Why

The old examples were tutorial-shaped; what a person evaluating the library wants first is what does it draw. A gallery answers that per symbology and per renderer at once.

Gallery output is generated, never committed — a gallery is a claim about what the library draws right now, so it is regenerated the same way the tests are run. ExamplesTest executes the generator on every CI build and verifies its pages against the registry (every symbology linked from index.md, every renderer mentioned on every page), so coverage of the gallery is a fact, not a promise.

Verification

  • composer lint (php-cs-fixer, PHPStan, Rector, kb-lint) — clean
  • vendor/bin/phpunit tests/ExamplesTest.php — 4 tests, 280 assertions, OK
  • composer validate --strict — valid
  • All 30 symbologies render on all 7 formats at default options; no Compatibility refusals with the chosen payloads

@s2x
s2x merged commit 7146801 into v2 Sep 3, 2026
5 checks passed
@s2x
s2x deleted the feature/examples-gallery branch September 3, 2026 22:08
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