Text.Highlighting.Kate.Syntax

highlighting-kate-0.6.2: Syntax highlighting

Copyright | Copyright (C) 2008-2011 John MacFarlane
License | GNU GPL, version 2 or above
Maintainer | John MacFarlane <jgm@berkeley.edu>
Stability | alpha
Portability | portable
Safe Haskell | None
Language | Haskell98

Text.Highlighting.Kate.Syntax

Description

Token lexer for various languages.

Synopsis

- highlightAs :: String -> String -> [SourceLine]
- languages :: [String]
- languageByFullName :: String -> Maybe String
- languagesByExtension :: String -> [String]
- languagesByFilename :: FilePath -> [String]

# Documentation

highlightAs

Arguments

:: String | Language syntax (e.g. "haskell") or extension (e.g. "hs").
-> String | Source code to highlight
-> [SourceLine] | List of highlighted source lines

Highlight source code. The source language may be specified by its canonical name (case-insensitive) or by a canonical extension (if unique). The parsers read the input lazily and parse line by line; results are returned immediately. Supported languages: `abc`, `actionscript`, `ada`, `agda`, `alert`, `alert_indent`, `apache`, `asn1`, `asp`, `awk`, `bash`, `bibtex`, `boo`, `c`, `changelog`, `clojure`, `cmake`, `coffee`, `coldfusion`, `commonlisp`, `cpp`, `cs`, `css`, `curry`, `d`, `diff`, `djangotemplate`, `dockerfile`, `dot`, `doxygen`, `doxygenlua`, `dtd`, `eiffel`, `elixir`, `email`, `erlang`, `fasm`, `fortran`, `fsharp`, `gcc`, `glsl`, `gnuassembler`, `go`, `hamlet`, `haskell`, `haxe`, `html`, `idris`, `ini`, `isocpp`, `java`, `javadoc`, `javascript`, `json`, `jsp`, `julia`, `kotlin`, `latex`, `lex`, `lilypond`, `literatecurry`, `literatehaskell`, `llvm`, `lua`, `m4`, `makefile`, `mandoc`, `markdown`, `mathematica`, `matlab`, `maxima`, `mediawiki`, `metafont`, `mips`, `modelines`, `modula2`, `modula3`, `monobasic`, `nasm`, `noweb`, `objectivec`, `objectivecpp`, `ocaml`, `octave`, `opencl`, `pascal`, `perl`, `php`, `pike`, `postscript`, `prolog`, `pure`, `python`, `r`, `relaxng`, `relaxngcompact`, `rest`, `rhtml`, `roff`, `ruby`, `rust`, `scala`, `scheme`, `sci`, `sed`, `sgml`, `sql`, `sqlmysql`, `sqlpostgresql`, `tcl`, `tcsh`, `texinfo`, `verilog`, `vhdl`, `xml`, `xorg`, `xslt`, `xul`, `yacc`, `yaml`, `zsh`.

languages :: [String]

List of supported languages.

languageByFullName :: String -> Maybe String

Lookup canonical language name by full syntaxName (e.g. C for Cs).

languagesByExtension :: String -> [String]

Returns a list of languages appropriate for the given file extension.

languagesByFilename :: FilePath -> [String]

Returns a list of languages appropriate for the given filename.