illuminate-0.1: A fast syntax highlighting library built with alex.

Text.Highlighting.Illuminate.Format

Synopsis

Documentation

data Options Source

Constructors

Options 

Fields

optStyle :: Style

Highlighting style

optNumberLines :: Bool

Number lines?

optStartNumber :: Int

Number of first line

optAnchors :: Bool

Add anchor with number as ID to each line

type Style = TokenType -> [Styling]Source

A Style is a generic instruction for formatting a token of the given type. The same style can be used for various output formats (HTML, ANSI, LaTeX...).

data Color Source

Constructors

Aqua 
Black 
Blue 
Fuchsia 
Gray 
Green 
Lime 
Maroon 
Navy 
Olive 
Purple 
Red 
Silver 
Teal 
White 
Yellow 
Hex Integer Color

Second argument is a fallback color

Instances

colorful :: StyleSource

A colorful style.

hscolour :: StyleSource

A style based on hscolour.

monochrome :: StyleSource

A black and white style.

toANSI :: Options -> Tokens -> StringSource

Highlight tokens using ANSI control sequences.

toLaTeX :: Options -> Tokens -> StringSource

Highlight as LaTeX. Use with

 \usepackage{fancyvrb}
 \usepackage[usenames,dvipsnames]{color}

toXHtmlCSS :: Options -> Tokens -> HtmlSource

Highlight as XHTML with CSS classes.

toXHtmlInline :: Options -> Tokens -> HtmlSource

Highlight as XHTML with inline styles.

cssFor :: Options -> StringSource

CSS snippet appropriate for the specificed options.

toHtmlCSS :: Options -> Tokens -> HtmlSource

Highlight as HTML with CSS classes.

toHtmlInline :: Options -> Tokens -> HtmlSource

Highlight as HTML with inline styles.