feat: use custom Nix highlight queries for richer syntax colors

- queries/nix-highlights.scm: Adapted from Helix editor queries.
  Properly identifies functions, properties, variable parameters,
  escape sequences, and string interpolation. Much richer than
  the bundled tree-sitter-nix query (99 lines vs 113 lines).

- src/highlight.rs: Load custom Nix query via include_str!
  instead of using bundled HIGHLIGHTS_QUERY.

- static/style.css: Fix variable (#e36209) and punctuation (#586069)
  colors to be distinct from text color.

Results: hl-function now appears (6 occurrences), hl-property
visible (17), hl-variable reduced from 43 to 17. Functions like
mkShell now render in purple/blue instead of orange.
This commit is contained in:
Timothy DeHerrera
2026-01-25 20:18:48 -07:00
parent 5b7805d753
commit b16246fba6
3 changed files with 138 additions and 5 deletions

View File

@@ -278,10 +278,10 @@ article.post header {
--hl-type: #005cc5;
--hl-number: #005cc5;
--hl-operator: #d73a49;
--hl-variable: #24292e;
--hl-variable: #e36209;
--hl-constant: #005cc5;
--hl-property: #005cc5;
--hl-punctuation: #24292e;
--hl-punctuation: #586069;
--hl-punctuation-special: #d73a49;
--hl-attribute: #22863a;
--hl-escape: #005cc5;
@@ -298,10 +298,10 @@ article.post header {
--hl-type: #79b8ff;
--hl-number: #79b8ff;
--hl-operator: #f97583;
--hl-variable: #e1e4e8;
--hl-variable: #ffab70;
--hl-constant: #79b8ff;
--hl-property: #79b8ff;
--hl-punctuation: #e1e4e8;
--hl-punctuation: #a0a0a0;
--hl-punctuation-special: #f97583;
--hl-attribute: #85e89d;
--hl-escape: #79b8ff;