feat(13.1): colorize + color_dic → ColorNode renderer
CI / cargo fmt --check (push) Successful in 26s
CI / cargo clippy (push) Successful in 1m24s
CI / cargo test (push) Successful in 1m24s
CI / editor keymaps (push) Successful in 1m45s

Closes the last pending §13.1 entries:

- **`nuwiki.colorize`** (client-side, Lua + VimL) — wraps the word
  at cursor (or the visual selection on Neovim) in an inline
  `<span style="color:%c">…</span>` template. Matches vimwiki's
  default `color_tag_template`. Bound to `<Leader>wc` in both
  normal and visual mode on both editor paths; the previous
  "deferred" stub is gone.

- **`color_dic` → renderer** — `HtmlConfig` gains a
  `color_dic: HashMap<String, String>` field reading the same key
  out of `initializationOptions` / `didChangeConfiguration`. The
  HTML export path threads it into `HtmlRenderer::with_colors`;
  `ColorNode` now picks `style="color:<value>"` when the colour
  name is in the dict, falling back to the existing
  `class="color-<name>"` when it isn't.

SPEC §13.1 is fully checked off — the table moved from "deferred
sketch" to a per-command status table marking all 11 commands done,
plus a note on the `color_dic` follow-up landing alongside. README's
"Phase 14 list & table edit commands" row now reads  without the
deferred-subset caveat, and the §13.1-blocked text-objects note in
the keymaps section is rephrased as "planned follow-ups".

Tests: 4 new in `phase17_colorize.rs` covering the renderer
fallback when the dict is empty, the inline-style emission for a
listed name, the fallback path for an unlisted name in a populated
dict, and the `initializationOptions` JSON shape. Total 414 Rust
tests pass; clippy clean; keymap harness still 20/20.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-12 14:45:39 +00:00
parent 4245424d2f
commit de8b8fa30d
10 changed files with 226 additions and 47 deletions
+4 -7
View File
@@ -22,9 +22,7 @@ display results.
-`:Vimwiki*` command compat + `:Nuwiki*` canonical aliases.
See [`SPEC.md`](./SPEC.md) for the architecture, design decisions, and
the full phase log; the [pending-work section](./SPEC.md#13-pending-implementation)
lists the few items still in flight (table/list rewriter commands and
colorize).
the full phase log.
---
@@ -251,9 +249,8 @@ Neovim, or `let g:nuwiki_no_default_mappings = 1` in Vim.
| `ah` / `ih` | A heading (with / without the heading line itself) |
Additional text objects (`aH`, `iH`, `a\`, `i\`, `ac`, `ic`, `al`,
`il`) ship once the table/list rewriter commands from
[SPEC §13.1](./SPEC.md#131-phase-14--listtablelinkcolorize-commands)
land.
`il`) are planned follow-ups now that the table/list rewriter
commands they depend on have shipped.
### Health check
@@ -352,7 +349,7 @@ scratch wiki with sample pages, links, checkboxes, and tags.
| 11 | Plumbing prerequisites | ✅ done |
| 12 | Tags | ✅ done |
| 13 | Workspace edits + executeCommand | ✅ done |
| 14 | List & table edit commands | ✅ done (focused subset; table/list-renumber/colorize deferred — see [SPEC §13.1](./SPEC.md#131-phase-14--listtablelinkcolorize-commands)) |
| 14 | List & table edit commands | ✅ done |
| 15 | Link health + TOC/index generation | ✅ done |
| 16 | Diary | ✅ done |
| 17 | HTML export commands | ✅ done |