Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

An efficient syntax highlighting library in Haskell, using alex-generated lexers

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 Text
Octocat-spinner-32 alex
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 Setup.hs
Octocat-spinner-32 TODO
Octocat-spinner-32 illuminate.cabal
Octocat-spinner-32 illuminate.hs
Why another highlighting library?

highlighting-kate is too slow and can really put a load on a server when
highlighting long source files. illuminate is much faster (100 times
faster in one test!). The downside is that you have to write your own
lexers. But this is not actually all that difficult.

To try this out:

    cabal install
    illuminate illuminate.hs
    illuminate --help

Right now, illuminate can highlight haskell, literate haskell, cabal,
alex, c, c++, c#, d, diff, python, ruby, java, html, rhtml, rxml, xml,
javascript, css, sh, tex, and bibtex. (Note that it handles embedded haskell
in alex files, embedded javascript and css in html, and embedded ruby in

It can format output in HTML or XHTML (with embedded style tags or CSS),
LaTeX (using fancyvrb), or with ANSI escape codes.

Want to write a lexer for a language?
Study the examples in Text/Highlight/Illuminate/*.x.

To test your lexer, add references to it in the three obvious places in
illuminate.cabal, and in the two obvious places in
Text/Highlighting/Illuminate.hs. Then 'cabal install'...

Something went wrong with that request. Please try again.