en Home Static site generator V Language Setup

Highlighter

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.

Features

Installation

For V Users

v install https://codeberg.org/tamer/highlighter.git

For C Users

make compile_c_linux   - Build using GCC from the C file
make compile_c_windows - Build for Win using MinGW from the C file

Usage

As a CLI tool

highlight --verbose --force /var/www

As a Module

import highlighter

mut hl := highlighter.new_manager()
html_output := hl.highlight_html(markdown_generated_html)

Structure

.
├── 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

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgements


First Created: 2026-04-12 22:24:06
Last Modified: 2026-04-13 13:18