package higlo
Install
Dune Dependency
Authors
Maintainers
Sources
md5=8e6ad939c2e0fd0640efd4a10e4137fd
sha512=fdccc8aaebe084f0b5e5dfbeabf5a1b94186ef023431492c2083d9949237761946c7e9e195a4a81fc0f72032224f4942d3adb2590aa22ff35804b2d9bc2ea902
doc/index.html
Higlo
Higlo is an OCaml library for syntax highlighting. Higlo could mean Highlighting in Ocaml.
The purpose of Higlo is not to provide syntax highlighting for every language, nor target every format (HTML, LaTeX, ...). It provides a simple way to support additional languages and develop the generator for the output format you need.
By now, only some input languages are supported (OCaml, XML, JSON and Graphviz/dot), and it only generates Xtmpl.Rewrite.tree
to highlight code in XML. Developing support for additional input languages is just a matter of writing a Sedlex lexer. Supporting another output format only requires mapping values of type Higlo.Lang.token
.
See the OCaml lexer for an example of Higlo Sedlex lexer.
API
The API consists in these modules: Higlo.Lang
, Higlo.Printers
.