Rebuild examples as a generated symbology gallery - #236
Merged
Conversation
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.
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 eachexamples/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 skippedexamples/assets/— the image files the pages point atThe list of symbologies and renderers comes from the registry, so nothing in the generator hardcodes "every" — a symbology added to
Defaultsappears 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.
ExamplesTestexecutes the generator on every CI build and verifies its pages against the registry (every symbology linked fromindex.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) — cleanvendor/bin/phpunit tests/ExamplesTest.php— 4 tests, 280 assertions, OKcomposer validate --strict— validCompatibilityrefusals with the chosen payloads