highlighting-kate is a syntax highlighting librarywith support for nearly one hundred languages. The syntaxparsers are automatically generated from Katesyntax descriptions (http://kate-editor.org/),so any syntax supported by Kate can be added.An (optional) command-line program is provided, alongwith a utility for generating new parsers from KateXML syntax descriptions.__This library has been deprecated.Please use skylighting instead.__
[Index]
Name | Description | Default |
---|---|---|
executable | Build the highlighting-kate executable. | Disabled |
pcre-light | Use the pcre-light library instead of regex-pcre-builtin | Disabled |
Use-f <flag> to enable a flag, or-f -<flag> to disable that flag.More info
For package maintainers and hackage trustees
Candidates
This library has been deprecated. Please use skylightinginstead(Hackage|GitHub).
A Haskell source code highlighting library, basedon Kate's syntax description files (http://kate-editor.org/),nowpart of the KDE Framework's "KTextEditor" component.It can produce both HTML and LaTeX output.
To install, use thestack 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 syntaxdefinitions.
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 isput into$HOME/.local/bin
. To avoid creation of theexecutable, use--flag highlighting-kate:-executable
with thestack
commands above.
If you want to use highlighting-kate as a library in a Haskellprogram, see the API documentation athttps://hackage.haskell.org/package/highlighting-kate.
To run thehighlighting-kate
program, specify the languagename 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 itfrom 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 includedefault styles in the generated HTML, unless a link to a CSS file isprovided using the '--css' option. Some sample CSS files can be foundin 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 tocreate their own CSS files that use language-specific classes.
The parsers in Text/Highlighting/Kate/Syntax were automatically generatedfrom the Kate syntax definitions in the xml directory. You may modifythe xml files in this directory, or add new ones, and then regeneratethe 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 ktexteditorrepository:
git clone git://anongit.kde.org/ktexteditor
The syntax definitions can then be found in
src/syntax/data
There is information on the syntax highlighting definitions athttps://docs.kde.org/stable5/en/applications/katepart/highlight.html. See alsohttp://kate-editor.org/2005/03/24/writing-a-syntax-highlighting-file/.
Thanks are due to all the authors of these syntax definitions.
Changes have been made to the following xml files (diffs havebeen left in the directory, with .patch extensions):
<?php
prefix not needed.