feat: add tree-sitter syntax highlighting module

- Cargo.toml: Add tree-sitter-highlight + grammar crates
  (rust, bash, json). TOML dropped due to API incompatibility.
- src/highlight.rs: Language enum, highlight_code() function,
  4 unit tests covering parsing and HTML generation.
- Uses static HTML_ATTRS array for zero-allocation rendering.
This commit is contained in:
Timothy DeHerrera
2026-01-24 20:38:02 -07:00
parent 5317da94c4
commit ba5e97dfb7
4 changed files with 339 additions and 2 deletions

View File

@@ -11,3 +11,9 @@ maud = "0.26"
pulldown-cmark = "0.12"
thiserror = "2"
walkdir = "2"
# Syntax highlighting
tree-sitter-bash = "0.23"
tree-sitter-highlight = "0.24"
tree-sitter-json = "0.24"
tree-sitter-rust = "0.23"