Highlighter is a code highlighter module for v, and a standalone cli tool.
A lightweight, native V module to inject (Prism-compatible css) syntax highlighting into static HTML files at build time. No client-side JavaScript required.
The shell command Highlighter will walk all sub direcories looking for html files.
token classes.class="language-xxx" or defaults to Bash.v install https://codeberg.org/tamer/highlighter.git
make compile_c_linux - Build using GCC from the C file
make compile_c_windows - Build for Win using MinGW from the C file
highlight --verbose --force /var/www
import highlighter
mut hl := highlighter.new_manager()
html_output := hl.highlight_html(markdown_generated_html)
.
├── highlighter.v # Logic moved to root
├── v.mod # Module info
├── highlight_standalone.c # Standalone C
├── Makefile
├── lang_data/ # JSON files
├── cmd/
│ └── main.v # CLI entry point
└── convert.lua # Bootstrap script
Distributed under the MIT License. See LICENSE for more information.
First Created: 2026-04-12 22:24:06
Last Modified: 2026-04-13 13:18