highlighting-kate-0.5.15: Syntax highlighting

CopyrightCopyright (C) 2008-2011 John MacFarlane
LicenseGNU GPL, version 2 or above
MaintainerJohn MacFarlane <jgm@berkeley.edu>
Stabilityalpha
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Text.Highlighting.Kate.Format.HTML

Description

Formatters that convert a list of annotated source lines to HTML.

Synopsis

Documentation

formatHtmlInline :: FormatOptions -> [SourceLine] -> Html Source

Format tokens using HTML spans inside code tags. For example, A KeywordTok is rendered as a span with class kw. Short class names correspond to TokenTypes as follows: KeywordTok = kw, DataTypeTok = dt, DecValTok = dv, BaseNTok = bn, FloatTok = fl, CharTok = ch, StringTok = st, CommontTok = co, OtherTok = ot, AlertTok = al, FunctionTok = fu, RegionMarkerTok = re, ErrorTok = er. A NormalTok is not marked up at all.

formatHtmlBlock :: FormatOptions -> [SourceLine] -> Html Source

Format tokens as an HTML pre block. If line numbering is selected, this is put into a table row with line numbers in the left cell. The whole code block is wrapped in a div element to aid styling (e.g. the overflow-x property).

styleToCss :: Style -> String Source

Returns CSS for styling highlighted code according to the given style.