Add a hero card to all six READMEs - #12
Merged
Merged
Conversation
A link to this repository unfurls as GitHub's generated card: the owner avatar, the repository name, and the description, in the same layout as every other repository. The card is what a reader sees on LinkedIn, Slack, and Discord before they see a single line of the style. The image is the style's own argument, drawn as two air traffic control flight progress strips. The unstyled reply is one undivided box; its text overruns the strip and fades off the right edge. The Attention Control reply is a field grid, one datum per box: ACTION, EDIT, STATE, NEXT. The example is the one already in "What changes", so the card and the README cite the same edit at src/auth.ts:47. The header carries both tagline lines, including "Written for a reader with ADHD." A card that names the discipline but not the reader it was written for describes the wrong half of the project. Alt text is translated in each of the five other READMEs, so a reader using a screen reader does not hit an English string in a Korean file. This commit does not change the unfurl. GitHub takes og:image from the repository's social preview setting, not from README content, and there is no REST endpoint for that upload: og:image https://opengraph.githubassets.com/6801222b.../aaddrick/attention-control The same file has to be uploaded by hand at Settings > General > Social preview. It is 1280x640 and 372 KB, inside the 1 MB limit. The generator is not committed. It needs Saira Condensed and IBM Plex Mono, so vendoring it means vendoring six font files or adding a download step to the build. Four gates pass. tests/test_readmes.py is unaffected: it compares code fences, inline spans, and numbered rules, and a centered img tag is none of those.
PR #12 shipped .github/assets/hero.png with no way to redraw it. A change to the header text, the example, or the harness list meant redrawing the card by hand in an image editor, or reconstructing the script from nothing. scripts/make_card.py draws the committed file. Verified: a fresh render from the vendored fonts is byte-identical to the PNG already on this branch. 8499f73a93e7aedba728e2b570d9124cda0acb0f6feb9afe83b1f340826bde40 The fonts are vendored, not downloaded. The build previously read them from google/fonts@main, and that branch moves, so the same script would draw a different card next month. assets/fonts/ holds the three Saira Condensed weights and the two IBM Plex Mono weights the script actually opens, 576 KB. Both families are OFL and both license texts sit beside them. NOTICE.md credits both, with versions read from the font name tables: Saira Condensed 0.072, IBM Plex Mono 2.3. No gate runs this script. Pillow and NumPy are not test dependencies, and CI installs neither. A checksum gate comparing a fresh render against the committed PNG would fail on a Pillow upgrade that changed encoding without changing a pixel, so the card stays a file you redraw and commit yourself. CLAUDE.md says so, next to the two facts about the card that no test holds: it cites the same src/auth.ts:47 the README cites, and the social preview upload is manual. Four gates pass. AGENTS.md is the regenerated mirror.
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.
Two commits: the card, then the generator that draws it.
What changed
A 1280x640 card at
.github/assets/hero.png, shown above the title inREADME.mdand the five translations, andscripts/make_card.py, which draws it from five vendored fonts inassets/fonts/.The image is the style's own argument, drawn as two air traffic control flight progress strips. The unstyled reply is one undivided box whose text overruns the strip and fades off the right edge. The Attention Control reply is a field grid, one datum per box: ACTION, EDIT, STATE, NEXT. The example is the one already in "What changes", so the card and the README cite the same edit at
src/auth.ts:47.The header carries both tagline lines, including "Written for a reader with ADHD."
Alt text is translated in each of the five other READMEs, so a screen reader user does not hit an English string in a Korean file.
Why
A link to this repository unfurled as GitHub's generated card, which is what a reader saw on LinkedIn, Slack, and Discord before they saw a line of the style.
The unfurl is already fixed, and this PR is not what fixed it
GitHub takes
og:imagefrom the repository's social preview setting, not from README content, and exposes no REST endpoint for that upload. The same file was uploaded by hand at Settings, General, Social preview. Verified live:Merging this PR does not change the unfurl, and reverting it would not change it back.
CLAUDE.mdnow says so, so the next person to redraw the card knows there is a second step.The generator is reproducible
A fresh render from the vendored fonts is byte-identical to the committed PNG:
The fonts are vendored rather than downloaded. The script previously read them from
google/fonts@main, and that branch moves, so the same script would draw a different card next month. 576 KB for the three Saira Condensed weights and two IBM Plex Mono weights the script actually opens. Both families are OFL, both license texts sit beside them, andNOTICE.mdcredits both with versions read from the font name tables.No gate runs the generator
Pillow and NumPy are not test dependencies and CI installs neither. A checksum gate comparing a fresh render against the committed PNG would fail on a Pillow upgrade that changed encoding without changing a pixel. The card is a file you redraw and commit yourself, and
CLAUDE.mdstates that alongside the two facts about it that no test can hold.Gates
All four pass.
tests/test_readmes.pyis unaffected: it compares code fences, inline spans, and numbered rules, and a centeredimgtag is none of those.AGENTS.mdis the regenerated mirror ofCLAUDE.md.