The highlighting-kate package

[Tags:deprecated, gpl, library, test]
Deprecated. in favor of skylighting

highlighting-kate is a syntax highlighting library with support for nearly one hundred languages. The syntax parsers are automatically generated from Kate syntax descriptions (, so any syntax supported by Kate can be added. An (optional) command-line program is provided, along with a utility for generating new parsers from Kate XML syntax descriptions. __This library has been deprecated. Please use skylighting instead.__

[Skip to Readme]


Versions 0.2, 0.2.1, 0.2.3, 0.2.4, 0.2.5,, 0.2.6,,, 0.2.7,,,, 0.2.9, 0.2.10, 0.3, 0.3.1, 0.4, 0.5,,,,,,, 0.5.1, 0.5.2, 0.5.3,,,,,,,,,, 0.5.4, 0.5.5,, 0.5.6,, 0.5.7,, 0.5.8,,,,,, 0.5.9, 0.5.10, 0.5.11,, 0.5.12, 0.5.13, 0.5.14, 0.5.15, 0.6, 0.6.1, 0.6.2,, 0.6.3, 0.6.4
Change log changelog
Dependencies base (>=4.4 && <5), blaze-html (>=0.4.2 && <0.10), bytestring, containers, filepath, highlighting-kate, mtl, parsec, pcre-light (==0.4.*), regex-pcre-builtin (>=, utf8-string [details]
License GPL
Author John MacFarlane
Stability Unknown
Category Text
Home page
Source repository head: git clone git://
Uploaded Tue Jan 31 10:38:06 UTC 2017 by JohnMacFarlane
Distributions Debian:0.6.1, Fedora:0.6.1, FreeBSD:0.6, LTSHaskell:0.6.4, NixOS:0.6.4, Stackage:0.6.4, Tumbleweed:0.6.3
Downloads 73836 total (142 in the last 30 days)
0 []
Status Docs available [build log]
Last success reported on 2017-01-31 [all 1 reports]




executableBuild the highlighting-kate executable.DisabledAutomatic
pcre-lightUse the pcre-light library instead of regex-pcre-builtinDisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainer's Corner

For package maintainers and hackage trustees

Readme for highlighting-kate

Readme for highlighting-kate-0.6.4


This library has been deprecated. Please use skylighting instead (Hackage | GitHub).

A Haskell source code highlighting library, based on Kate's syntax description files (, now part of the KDE Framework's "KTextEditor" component. It can produce both HTML and LaTeX output.


To install, use the stack tool:

stack install

Note: If you have checked out the source from the git repository, you will first need to do:

make prep

which generates some of the needed source files from xml syntax definitions.

To generate the documentation:

stack haddock

To run the test suite:

stack test

For an example of the use of the library, see highlighting-kate.hs.

By default, this installation method will install an executable, highlighting-kate, along with the library. Normally this is put into $HOME/.local/bin. To avoid creation of the executable, use --flag highlighting-kate:-executable with the stack commands above.


If you want to use highlighting-kate as a library in a Haskell program, see the API documentation at

To run the highlighting-kate program, specify the language name using -s:

highlighting-kate -s haskell highlighting-kate.hs > example.html

If you don't specify a language name, highlighting-kate will try to guess it from the file extension.highlighting-kate can also be used as a pipe, reading input from STDIN. For other options,

highlighting-kate --help

Styling is done using span tags. The Highlight program will include default styles in the generated HTML, unless a link to a CSS file is provided using the '--css' option. Some sample CSS files can be found in the css directory. These use generic class names (Normal, Keyword, DataType, DecVal, BaseN, Float, Char, String, Comment, Function, Others, Alert, Error). For more fine-grained highlighting, users may wish to create their own CSS files that use language-specific classes.

Adding syntax definitions

The parsers in Text/Highlighting/Kate/Syntax were automatically generated from the Kate syntax definitions in the xml directory. You may modify the xml files in this directory, or add new ones, and then regenerate the parsers by doing:

make prep

Note that ParseSyntaxFiles.hs requires the HXT package (>= 9.0.0). make prep should install this automatically.

To get the current Kate syntax highlighting files, clone the ktexteditor repository:

git clone git://

The syntax definitions can then be found in


There is information on the syntax highlighting definitions at See also

Thanks are due to all the authors of these syntax definitions.

Changes have been made to the following xml files (diffs have been left in the directory, with .patch extensions):

  • haskell.xml: Small changes to mapping of styles to token types.
  • lua.xml: Variables and constants highlighted as "normal", not keywords.
  • perl.xml: Small regex change due to differences in regex engines.
  • php.xml: Added fallthrough so <?php prefix not needed.
  • tcsh.xml: Replace invalid character assignment(?) of regex '\s' with ' '.