Inkjet - A batteries-included syntax highlighting library

51 points somewhereoutinspace

https://crates.io/crates/inkjet

syntect just wasn't the right fit for my project, so I struck out in search of an alternative.

I found tree-sitter-highlight - it was promising, but I wanted to support as many languages as possible without depending on individual crates for each one. Thus Inkjet was born!

Features:

  • Around 60 language grammars are bundled (amounting to ~11 million lines of C code) and linked into the executable - no need to load anything at runtime.
  • Pluggable formatters. Includes a basic HTML formatter.
  • Languages can be looked up from a token like rs.
  • Highlight into a String or a std::io::Writer.

Still technically a work in progress - I'd like to add more languages, at the very least, and see if I can speed up the build time - but it functions great in my original project!