highlighting-kate-0.5.5.1: Syntax highlighting

Portabilityportable
Stabilityalpha
MaintainerJohn MacFarlane <jgm@berkeley.edu>
Safe HaskellSafe-Inferred

Text.Highlighting.Kate.Types

Description

Definitions for data structures needed by highlighting-kate.

Synopsis

Documentation

type Context = (String, String)

A context: pair of syntax name and context name.

type ContextStack = [Context]

A stack of contexts. (Language-specific context stacks must be maintained because of IncludeRules.)

data SyntaxState

State for syntax parser.

Constructors

SyntaxState 

Fields

synStContexts :: ContextStack

Stack of contexts

synStLineNumber :: Int

Number of current line

synStPrevChar :: Char

Last character parsed

synStPrevNonspace :: Bool

True if we've parsed a nonspace

synStCaseSensitive :: Bool

Language is case-sensitive

synStKeywordCaseSensitive :: Bool

Keywords are case-sensitive

synStCaptures :: [String]

List of regex captures from last capturing match

Instances

type Token = (TokenType, String)

A pair consisting of a list of attributes and some text.

type SourceLine = [Token]

A line of source, list of labeled source items.

type KateParser = GenParser Char SyntaxState

data TokenStyle

Constructors

TokenStyle 

Fields

tokenColor :: Maybe Color
 
tokenBackground :: Maybe Color
 
tokenBold :: Bool
 
tokenItalic :: Bool
 
tokenUnderline :: Bool
 

Instances

Read TokenStyle 
Show TokenStyle 

data Color

Constructors

RGB Word8 Word8 Word8 

Instances

Read Color 
Show Color 

class ToColor a where

Methods

toColor :: a -> Maybe Color

Instances

ToColor String 
ToColor (Double, Double, Double) 
ToColor (Word8, Word8, Word8) 

class FromColor a where

Methods

fromColor :: Color -> a

Instances

FromColor String 
FromColor (Double, Double, Double) 
FromColor (Word8, Word8, Word8) 

data Style

Instances

Read Style 
Show Style 

data FormatOptions

Options for formatting source code.

Constructors

FormatOptions 

Fields

numberLines :: Bool

Number lines

startNumber :: Int

Number of first line

lineAnchors :: Bool

Anchors on each line number

titleAttributes :: Bool

Html titles with token types

codeClasses :: [String]

Additional classes for Html code tag

containerClasses :: [String]

Additional classes for Html container tag (pre or table depending on numberLines)

Instances