|
Text.Highlighting.Kate | Portability | portable | Stability | alpha | Maintainer | John MacFarlane <jgm@berkeley.edu> |
|
|
|
Description |
This helper module exports the main highlighting and formatting
functions.
A typical application will combine a highlighter and a formatter:
main = do
code <- getContents
case highlightAs "ruby" code of
Right result -> putStrLn $ renderHtmlFragment $
formatAsXHtml [OptNumberLines] "ruby" result
Left err -> error $ "Could not parse input: " ++ err
|
|
Synopsis |
|
|
|
Documentation |
|
|
:: String | Language syntax
| -> String | Source code to highlight
| -> Either String [SourceLine] | Either error message or result
| True if extension belongs to language.
Highlight source code using a specified syntax definition.
|
|
|
|
List of supported languages.
|
|
|
Returns a list of languages appropriate for the given file extension.
|
|
|
|
|
|
Options for formatters.
| Constructors | OptNumberLines | Number lines
| OptNumberFrom Int | Number of first line
| OptTitleAttributes | Include title attributes
|
| Instances | |
|
|
|
|
|
A line of source, list of labeled source items.
|
|
|
A pair consisting of a list of attributes and some text.
|
|
|
|
Produced by Haddock version 2.6.0 |