yazi: palette doc image + regeneration script for kanagawa-dragon#10
Open
kriswill wants to merge 4 commits into
Open
yazi: palette doc image + regeneration script for kanagawa-dragon#10kriswill wants to merge 4 commits into
kriswill wants to merge 4 commits into
Conversation
5050d3b to
2c622e0
Compare
Document the kanagawa-dragon flavor's colors in a single rendered image, generated from the theme's own source files so it stays accurate. - scripts/render-yazi-palette.ts: bun script that parses flavor.toml (palette names + usage scan) and tmtheme.xml (minimal plist parser), then renders a labeled swatch grid via ImageMagick to _themes/kanagawa-dragon/palette.png. Re-run: `bun scripts/render-yazi-palette.ts`. - palette.png: UI theme (18 colors), tmtheme editor (6) and syntax scopes (21 unique colors), each labeled with name/hex/usage.
…om nix output The flavor is not strictly the dragon variant and will get local tweaks, so drop the -dragon suffix. flavor.toml/tmtheme.xml are now nix-generated, so expose the flavor as the yazi-kanagawa-flavor package and have render-yazi-palette.ts build it and read color names from lib/kanagawa.nix.
Refactor the single in-repo yazi flavor into four flavors generated from a
single palette source of truth, installed simultaneously, with a plugin to
switch between them at runtime.
- lib/kanagawa.nix → lib/kanagawa/ : raw palette (palette.nix, unchanged) plus
per-flavor semantic role tables (themes/{wave,dragon,lotus,kris}.nix). wave/
dragon/lotus are transcribed faithfully from kanagawa.nvim's themes.lua via a
shared mapper (themes/mk.nix); kris is the prior personal theme (wave editor +
syntax, dragon-family chrome) kept as explicit literals.
- pkgs/yazi-kanagawa-flavor/ : reusable builder ({name,title,uuid,appearance,
theme} → flavor.toml + tmtheme.xml), a shared spec list (flavors.nix), and
all.nix building every flavor. packages.nix exposes yazi-kanagawa-{wave,
dragon,lotus,kris}. kris output is byte-identical to the previous flavor
(flavor.toml identical; tmtheme identical sans name/semanticClass).
- yazi module: installs all four flavors; theme.toml is no longer managed by
programs.yazi but is an out-of-store symlink to a writable
~/.local/state/yazi/theme.toml, seeded once (default kanagawa-kris) by an
activation script so a saved selection survives rebuilds. Adds the
theme-switcher.yazi plugin (which-key menu → fs.write → notify "restart to
apply"; yazi has no live flavor reload) bound to `T`.
- render-yazi-palette.ts: documents all four flavors to _palette/kanagawa-*.png.
Note: the new kanagawa-dragon is a faithful canonical dragon, distinct from the
earlier `kanagawa` flavor (now kanagawa-kris).
2e87e2d to
fd540c8
Compare
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
Documents the kanagawa-dragon yazi theme's colors in a single rendered image, plus a script that regenerates it from the theme's own source files (so it can't drift).
Changes
scripts/render-yazi-palette.ts— abunscript that:flavor.toml(color names from the## Color palettecomment block, plus a usage scan showing where each hex is referenced, e.g.mgr.cwd,status.perm_read);tmtheme.xmlvia a minimal plist parser (handles the self-closing<string/>tags used for emptyfontStyles);palette.png.bun scripts/render-yazi-palette.ts. Font is discovered from the Nix store (overridable viaFONT_REGULAR/FONT_BOLD); deps arebun+ ImageMagick._themes/kanagawa-dragon/palette.png— the generated documentation image: UI theme (18 colors), tmtheme editor globals (6), and syntax scopes (21 unique colors), each labeled with name / hex / usage.Notes
#8ea4a2(used for all borders) is not named inflavor.toml's palette comment block; the script labels itdragonAquavia a small alias map.Verification
bun scripts/render-yazi-palette.ts→wrote .../palette.png (1760x2382)· flavor: 18, tmtheme editor: 6, scopes: 21.