Repository navigation
Harden the diagram renderer and drop empty diagram links - #14
Merged
Merged
Conversation
From the review of #10: - Reject every colour that bypasses palette.json: short and long hex, rgb()/hsl() and friends, and named colours in fill, stroke and other paint properties, in hand-drawn SVGs, .mmd sources and theme.json. - Name palette tokens as {token} in theme.json and .mmd bands and resolve them per mode, instead of reverse-matching hex. Light values no longer have to be unique, so surface is plain #ffffff again. - Turn off Mermaid's default band drop shadow, which glowed in dark mode. - Insert palette blocks with a function, not a regex template. - Make --hand and --mermaid mutually exclusive. - Embed light/dark diagram pairs without link wrappers, so the hidden variant no longer leaves an empty, focusable link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
Follow-ups from the code review of #10, which is already merged.
What changed
scripts/render_diagrams.pyfill="white",#333,rgba(...)orrect aquapassed silently and left a light colour in the dark variant. Now any colour literal (hex of any length,rgb()/hsl()/oklch()…, or a named colour infill,stroke,stop-color,colororbackground) stops the script with the file and the value:var(--token)..mmdsources andtheme.jsonmust use{token}.theme.jsonand the.mmdbands now name tokens ("actorBkg": "{actor-fill}",rect {band-request}), resolved once per mode.surfacegoes back to#fffffffrom the#fffffeworkaround.theme.jsonno longer repeats palette hex values.--handand--mermaidare mutually exclusive. Passing both used to render nothing and exit 0.theme.json(finding 7)drop-shadowon band rects is turned off. In the dark variants it showed as a light-grey glow.Docs (finding 5)
architecture.md,integrate.mdandoperate.mdare no longer wrapped in links. The hidden variant used to leave an empty, focusable<a>.develop.mddocuments the{token}syntax.Not changed
Verification
--hand --mermaidnow exits with an argparse error.mkdocs build --strictpasses, and the built pages contain no diagram<img>wrapped in an<a>.🤖 Generated with Claude Code