skylighting-0.3.3.1: syntax highlighting library

Safe Haskell | None
Language | Haskell2010

Skylighting.Types

Contents

- Syntax descriptions
- Tokens
- Styles
- Format options

Description

Basic types for Skylighting.

Synopsis

- type ContextName = (Text, Text)
- data KeywordAttr = KeywordAttr {
  - keywordCaseSensitive :: Bool
  - keywordDelims :: Set Char
  }
- data WordSet a
- makeWordSet :: (FoldCase a, Ord a) => Bool -> [a] -> WordSet a
- inWordSet :: (FoldCase a, Ord a) => a -> WordSet a -> Bool
- data Matcher
  - = DetectChar Char
  - | Detect2Chars Char Char
  - | AnyChar [Char]
  - | RangeDetect Char Char
  - | StringDetect Text
  - | WordDetect Text
  - | RegExpr RE
  - | Keyword KeywordAttr (WordSet Text)
  - | Int
  - | Float
  - | HlCOct
  - | HlCHex
  - | HlCStringChar
  - | HlCChar
  - | LineContinue
  - | IncludeRules ContextName
  - | DetectSpaces
  - | DetectIdentifier
- data Rule = Rule {
  - rMatcher :: Matcher
  - rAttribute :: TokenType
  - rIncludeAttribute :: Bool
  - rDynamic :: Bool
  - rCaseSensitive :: Bool
  - rChildren :: [Rule]
  - rLookahead :: Bool
  - rFirstNonspace :: Bool
  - rColumn :: Maybe Int
  - rContextSwitch :: [ContextSwitch]
  }
- data Context = Context {
  - cName :: Text
  - cSyntax :: Text
  - cRules :: [Rule]
  - cAttribute :: TokenType
  - cLineEmptyContext :: [ContextSwitch]
  - cLineEndContext :: [ContextSwitch]
  - cLineBeginContext :: [ContextSwitch]
  - cFallthrough :: Bool
  - cFallthroughContext :: [ContextSwitch]
  - cDynamic :: Bool
  }
- data ContextSwitch
  - = Pop
  - | Push ContextName
- data Syntax = Syntax {
  - sName :: Text
  - sFilename :: String
  - sShortname :: Text
  - sContexts :: Map Text Context
  - sAuthor :: Text
  - sVersion :: Text
  - sLicense :: Text
  - sExtensions :: [String]
  - sStartingContext :: Text
  }
- type SyntaxMap = Map Text Syntax
- type Token = (TokenType, Text)
- data TokenType
  - = KeywordTok
  - | DataTypeTok
  - | DecValTok
  - | BaseNTok
  - | FloatTok
  - | ConstantTok
  - | CharTok
  - | SpecialCharTok
  - | StringTok
  - | VerbatimStringTok
  - | SpecialStringTok
  - | ImportTok
  - | CommentTok
  - | DocumentationTok
  - | AnnotationTok
  - | CommentVarTok
  - | OtherTok
  - | FunctionTok
  - | VariableTok
  - | ControlFlowTok
  - | OperatorTok
  - | BuiltInTok
  - | ExtensionTok
  - | PreprocessorTok
  - | AttributeTok
  - | RegionMarkerTok
  - | InformationTok
  - | WarningTok
  - | AlertTok
  - | ErrorTok
  - | NormalTok
- type SourceLine = [Token]
- data TokenStyle = TokenStyle {
  - tokenColor :: Maybe Color
  - tokenBackground :: Maybe Color
  - tokenBold :: Bool
  - tokenItalic :: Bool
  - tokenUnderline :: Bool
  }
- defStyle :: TokenStyle
- data Color = RGB Word8 Word8 Word8
- class ToColor a where
- class FromColor a where
- data Style = Style {
  - tokenStyles :: [(TokenType, TokenStyle)]
  - defaultColor :: Maybe Color
  - backgroundColor :: Maybe Color
  - lineNumberColor :: Maybe Color
  - lineNumberBackgroundColor :: Maybe Color
  }
- data FormatOptions = FormatOptions {
  - numberLines :: Bool
  - startNumber :: Int
  - lineAnchors :: Bool
  - titleAttributes :: Bool
  - codeClasses :: [Text]
  - containerClasses :: [Text]
  }
- defaultFormatOpts :: FormatOptions

# Syntax descriptions

type ContextName = (Text, Text) Source #

Full name of a context: the first member of the pair is the full syntax name, the second the context name within that syntax.

data KeywordAttr Source #

Attributes controlling how keywords are interpreted.

Constructors

KeywordAttr |

Fields

- keywordCaseSensitive :: Bool
- keywordDelims :: Set Char

Instances

Eq KeywordAttr Source # |
Methods (==) :: KeywordAttr -> KeywordAttr -> Bool # (/=) :: KeywordAttr -> KeywordAttr -> Bool #
Data KeywordAttr Source # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> KeywordAttr -> c KeywordAttr #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c KeywordAttr #

toConstr :: KeywordAttr -> Constr #

dataTypeOf :: KeywordAttr -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c KeywordAttr) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KeywordAttr) #

gmapT :: (forall b. Data b => b -> b) -> KeywordAttr -> KeywordAttr #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> KeywordAttr -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> KeywordAttr -> r #

gmapQ :: (forall d. Data d => d -> u) -> KeywordAttr -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> KeywordAttr -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> KeywordAttr -> m KeywordAttr #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> KeywordAttr -> m KeywordAttr #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> KeywordAttr -> m KeywordAttr #

Ord KeywordAttr Source # |
Methods compare :: KeywordAttr -> KeywordAttr -> Ordering # (<) :: KeywordAttr -> KeywordAttr -> Bool # (<=) :: KeywordAttr -> KeywordAttr -> Bool # (>) :: KeywordAttr -> KeywordAttr -> Bool # (>=) :: KeywordAttr -> KeywordAttr -> Bool # max :: KeywordAttr -> KeywordAttr -> KeywordAttr # min :: KeywordAttr -> KeywordAttr -> KeywordAttr #
Read KeywordAttr Source # |
Methods readsPrec :: Int -> ReadS KeywordAttr # readList :: ReadS [KeywordAttr] # readPrec :: ReadPrec KeywordAttr # readListPrec :: ReadPrec [KeywordAttr] #
Show KeywordAttr Source # |
Methods showsPrec :: Int -> KeywordAttr -> ShowS # show :: KeywordAttr -> String # showList :: [KeywordAttr] -> ShowS #
Generic KeywordAttr Source # |
Associated Types type Rep KeywordAttr :: * -> * # Methods from :: KeywordAttr -> Rep KeywordAttr x # to :: Rep KeywordAttr x -> KeywordAttr #
Binary KeywordAttr Source # |
Methods put :: KeywordAttr -> Put # get :: Get KeywordAttr # putList :: [KeywordAttr] -> Put #
type Rep KeywordAttr Source # |

type Rep KeywordAttr = D1 (MetaData "KeywordAttr" "Skylighting.Types" "skylighting-0.3.3.1-AsHtinoWKN3LkTvrtcdLM" False) (C1 (MetaCons "KeywordAttr" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "keywordCaseSensitive") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) (S1 (MetaSel (Just Symbol "keywordDelims") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Set Char)))))

data WordSet a Source #

A set of "words," possibly case insensitive.

Instances

Eq a => Eq (WordSet a) Source # |
Methods (==) :: WordSet a -> WordSet a -> Bool # (/=) :: WordSet a -> WordSet a -> Bool #
(Ord a, Data a) => Data (WordSet a) Source # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WordSet a -> c (WordSet a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (WordSet a) #

toConstr :: WordSet a -> Constr #

dataTypeOf :: WordSet a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (WordSet a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (WordSet a)) #

gmapT :: (forall b. Data b => b -> b) -> WordSet a -> WordSet a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WordSet a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WordSet a -> r #

gmapQ :: (forall d. Data d => d -> u) -> WordSet a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> WordSet a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> WordSet a -> m (WordSet a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> WordSet a -> m (WordSet a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> WordSet a -> m (WordSet a) #

Ord a => Ord (WordSet a) Source # |
Methods compare :: WordSet a -> WordSet a -> Ordering # (<) :: WordSet a -> WordSet a -> Bool # (<=) :: WordSet a -> WordSet a -> Bool # (>) :: WordSet a -> WordSet a -> Bool # (>=) :: WordSet a -> WordSet a -> Bool # max :: WordSet a -> WordSet a -> WordSet a # min :: WordSet a -> WordSet a -> WordSet a #
(Ord a, Read a) => Read (WordSet a) Source # |
Methods readsPrec :: Int -> ReadS (WordSet a) # readList :: ReadS [WordSet a] # readPrec :: ReadPrec (WordSet a) # readListPrec :: ReadPrec [WordSet a] #
Show a => Show (WordSet a) Source # |
Methods showsPrec :: Int -> WordSet a -> ShowS # show :: WordSet a -> String # showList :: [WordSet a] -> ShowS #
Generic (WordSet a) Source # |
Associated Types type Rep (WordSet a) :: * -> * # Methods from :: WordSet a -> Rep (WordSet a) x # to :: Rep (WordSet a) x -> WordSet a #
Binary a => Binary (WordSet a) Source # |
Methods put :: WordSet a -> Put # get :: Get (WordSet a) # putList :: [WordSet a] -> Put #
type Rep (WordSet a) Source # |

type Rep (WordSet a) = D1 (MetaData "WordSet" "Skylighting.Types" "skylighting-0.3.3.1-AsHtinoWKN3LkTvrtcdLM" False) ((:+:) (C1 (MetaCons "CaseSensitiveWords" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Set a)))) (C1 (MetaCons "CaseInsensitiveWords" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Set a)))))

makeWordSet :: (FoldCase a, Ord a) => Bool -> [a] -> WordSet a Source #

A set of words to match (either case-sensitive or case-insensitive).

inWordSet :: (FoldCase a, Ord a) => a -> WordSet a -> Bool Source #

Test for membership in a `WordSet`.

data Matcher Source #

Matchers correspond to the element types in a context.

Constructors

DetectChar Char |
Detect2Chars Char Char |
AnyChar [Char] |
RangeDetect Char Char |
StringDetect Text |
WordDetect Text |
RegExpr RE |
Keyword KeywordAttr (WordSet Text) |
Int |
Float |
HlCOct |
HlCHex |
HlCStringChar |
HlCChar |
LineContinue |
IncludeRules ContextName |
DetectSpaces |
DetectIdentifier |

Instances

Eq Matcher Source # |
Methods (==) :: Matcher -> Matcher -> Bool # (/=) :: Matcher -> Matcher -> Bool #
Data Matcher Source # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Matcher -> c Matcher #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Matcher #

toConstr :: Matcher -> Constr #

dataTypeOf :: Matcher -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Matcher) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Matcher) #

gmapT :: (forall b. Data b => b -> b) -> Matcher -> Matcher #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Matcher -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Matcher -> r #

gmapQ :: (forall d. Data d => d -> u) -> Matcher -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Matcher -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Matcher -> m Matcher #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Matcher -> m Matcher #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Matcher -> m Matcher #

Ord Matcher Source # |
Methods compare :: Matcher -> Matcher -> Ordering # (<) :: Matcher -> Matcher -> Bool # (<=) :: Matcher -> Matcher -> Bool # (>) :: Matcher -> Matcher -> Bool # (>=) :: Matcher -> Matcher -> Bool # max :: Matcher -> Matcher -> Matcher # min :: Matcher -> Matcher -> Matcher #
Read Matcher Source # |
Methods readsPrec :: Int -> ReadS Matcher # readList :: ReadS [Matcher] # readPrec :: ReadPrec Matcher # readListPrec :: ReadPrec [Matcher] #
Show Matcher Source # |
Methods showsPrec :: Int -> Matcher -> ShowS # show :: Matcher -> String # showList :: [Matcher] -> ShowS #
Generic Matcher Source # |
Associated Types type Rep Matcher :: * -> * # Methods from :: Matcher -> Rep Matcher x # to :: Rep Matcher x -> Matcher #
Binary Matcher Source # |
Methods put :: Matcher -> Put # get :: Get Matcher # putList :: [Matcher] -> Put #
type Rep Matcher Source # |

type Rep Matcher = D1 (MetaData "Matcher" "Skylighting.Types" "skylighting-0.3.3.1-AsHtinoWKN3LkTvrtcdLM" False) ((:+:) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "DetectChar" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Char))) (C1 (MetaCons "Detect2Chars" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Char)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Char))))) ((:+:) (C1 (MetaCons "AnyChar" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Char]))) (C1 (MetaCons "RangeDetect" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Char)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Char)))))) ((:+:) ((:+:) (C1 (MetaCons "StringDetect" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text))) (C1 (MetaCons "WordDetect" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))) ((:+:) (C1 (MetaCons "RegExpr" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 RE))) ((:+:) (C1 (MetaCons "Keyword" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 KeywordAttr)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (WordSet Text))))) (C1 (MetaCons "Int" PrefixI False) U1))))) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "Float" PrefixI False) U1) (C1 (MetaCons "HlCOct" PrefixI False) U1)) ((:+:) (C1 (MetaCons "HlCHex" PrefixI False) U1) (C1 (MetaCons "HlCStringChar" PrefixI False) U1))) ((:+:) ((:+:) (C1 (MetaCons "HlCChar" PrefixI False) U1) (C1 (MetaCons "LineContinue" PrefixI False) U1)) ((:+:) (C1 (MetaCons "IncludeRules" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ContextName))) ((:+:) (C1 (MetaCons "DetectSpaces" PrefixI False) U1) (C1 (MetaCons "DetectIdentifier" PrefixI False) U1))))))

data Rule Source #

A rule corresponds to one of the elements of a Kate syntax highlighting "context."

Constructors

Rule |

Fields

- rMatcher :: Matcher
- rAttribute :: TokenType
- rIncludeAttribute :: Bool
- rDynamic :: Bool
- rCaseSensitive :: Bool
- rChildren :: [Rule]
- rLookahead :: Bool
- rFirstNonspace :: Bool
- rColumn :: Maybe Int
- rContextSwitch :: [ContextSwitch]

Instances

Eq Rule Source # |
Methods (==) :: Rule -> Rule -> Bool # (/=) :: Rule -> Rule -> Bool #
Data Rule Source # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Rule -> c Rule #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Rule #

toConstr :: Rule -> Constr #

dataTypeOf :: Rule -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Rule) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Rule) #

gmapT :: (forall b. Data b => b -> b) -> Rule -> Rule #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Rule -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Rule -> r #

gmapQ :: (forall d. Data d => d -> u) -> Rule -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Rule -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Rule -> m Rule #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Rule -> m Rule #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Rule -> m Rule #

Ord Rule Source # |
Methods compare :: Rule -> Rule -> Ordering # (<) :: Rule -> Rule -> Bool # (<=) :: Rule -> Rule -> Bool # (>) :: Rule -> Rule -> Bool # (>=) :: Rule -> Rule -> Bool # max :: Rule -> Rule -> Rule # min :: Rule -> Rule -> Rule #
Read Rule Source # |
Methods readsPrec :: Int -> ReadS Rule # readList :: ReadS [Rule] # readPrec :: ReadPrec Rule # readListPrec :: ReadPrec [Rule] #
Show Rule Source # |
Methods showsPrec :: Int -> Rule -> ShowS # show :: Rule -> String # showList :: [Rule] -> ShowS #
Generic Rule Source # |
Associated Types type Rep Rule :: * -> * # Methods from :: Rule -> Rep Rule x # to :: Rep Rule x -> Rule #
Binary Rule Source # |
Methods put :: Rule -> Put # get :: Get Rule # putList :: [Rule] -> Put #
type Rep Rule Source # |

type Rep Rule = D1 (MetaData "Rule" "Skylighting.Types" "skylighting-0.3.3.1-AsHtinoWKN3LkTvrtcdLM" False) (C1 (MetaCons "Rule" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "rMatcher") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Matcher)) (S1 (MetaSel (Just Symbol "rAttribute") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 TokenType))) ((:*:) (S1 (MetaSel (Just Symbol "rIncludeAttribute") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) ((:*:) (S1 (MetaSel (Just Symbol "rDynamic") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) (S1 (MetaSel (Just Symbol "rCaseSensitive") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "rChildren") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Rule])) (S1 (MetaSel (Just Symbol "rLookahead") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool))) ((:*:) (S1 (MetaSel (Just Symbol "rFirstNonspace") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) ((:*:) (S1 (MetaSel (Just Symbol "rColumn") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int))) (S1 (MetaSel (Just Symbol "rContextSwitch") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ContextSwitch])))))))

data Context Source #

A Context corresponds to a context element in a Kate syntax description.

Constructors

Context |

Fields

- cName :: Text
- cSyntax :: Text
- cRules :: [Rule]
- cAttribute :: TokenType
- cLineEmptyContext :: [ContextSwitch]
- cLineEndContext :: [ContextSwitch]
- cLineBeginContext :: [ContextSwitch]
- cFallthrough :: Bool
- cFallthroughContext :: [ContextSwitch]
- cDynamic :: Bool

Instances

Eq Context Source # |
Methods (==) :: Context -> Context -> Bool # (/=) :: Context -> Context -> Bool #
Data Context Source # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Context -> c Context #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Context #

toConstr :: Context -> Constr #

dataTypeOf :: Context -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Context) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Context) #

gmapT :: (forall b. Data b => b -> b) -> Context -> Context #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Context -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Context -> r #

gmapQ :: (forall d. Data d => d -> u) -> Context -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Context -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Context -> m Context #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Context -> m Context #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Context -> m Context #

Ord Context Source # |
Methods compare :: Context -> Context -> Ordering # (<) :: Context -> Context -> Bool # (<=) :: Context -> Context -> Bool # (>) :: Context -> Context -> Bool # (>=) :: Context -> Context -> Bool # max :: Context -> Context -> Context # min :: Context -> Context -> Context #
Read Context Source # |
Methods readsPrec :: Int -> ReadS Context # readList :: ReadS [Context] # readPrec :: ReadPrec Context # readListPrec :: ReadPrec [Context] #
Show Context Source # |
Methods showsPrec :: Int -> Context -> ShowS # show :: Context -> String # showList :: [Context] -> ShowS #
Generic Context Source # |
Associated Types type Rep Context :: * -> * # Methods from :: Context -> Rep Context x # to :: Rep Context x -> Context #
Binary Context Source # |
Methods put :: Context -> Put # get :: Get Context # putList :: [Context] -> Put #
type Rep Context Source # |

type Rep Context = D1 (MetaData "Context" "Skylighting.Types" "skylighting-0.3.3.1-AsHtinoWKN3LkTvrtcdLM" False) (C1 (MetaCons "Context" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "cName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) (S1 (MetaSel (Just Symbol "cSyntax") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text))) ((:*:) (S1 (MetaSel (Just Symbol "cRules") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Rule])) ((:*:) (S1 (MetaSel (Just Symbol "cAttribute") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 TokenType)) (S1 (MetaSel (Just Symbol "cLineEmptyContext") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ContextSwitch]))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "cLineEndContext") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ContextSwitch])) (S1 (MetaSel (Just Symbol "cLineBeginContext") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ContextSwitch]))) ((:*:) (S1 (MetaSel (Just Symbol "cFallthrough") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) ((:*:) (S1 (MetaSel (Just Symbol "cFallthroughContext") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ContextSwitch])) (S1 (MetaSel (Just Symbol "cDynamic") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))))))

data ContextSwitch Source #

A context switch, either pops or pushes a context.

Constructors

Pop |
Push ContextName |

Instances

Eq ContextSwitch Source # |
Methods (==) :: ContextSwitch -> ContextSwitch -> Bool # (/=) :: ContextSwitch -> ContextSwitch -> Bool #
Data ContextSwitch Source # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ContextSwitch -> c ContextSwitch #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ContextSwitch #

toConstr :: ContextSwitch -> Constr #

dataTypeOf :: ContextSwitch -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ContextSwitch) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ContextSwitch) #

gmapT :: (forall b. Data b => b -> b) -> ContextSwitch -> ContextSwitch #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ContextSwitch -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ContextSwitch -> r #

gmapQ :: (forall d. Data d => d -> u) -> ContextSwitch -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ContextSwitch -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ContextSwitch -> m ContextSwitch #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ContextSwitch -> m ContextSwitch #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ContextSwitch -> m ContextSwitch #

Ord ContextSwitch Source # |
Methods compare :: ContextSwitch -> ContextSwitch -> Ordering # (<) :: ContextSwitch -> ContextSwitch -> Bool # (<=) :: ContextSwitch -> ContextSwitch -> Bool # (>) :: ContextSwitch -> ContextSwitch -> Bool # (>=) :: ContextSwitch -> ContextSwitch -> Bool # max :: ContextSwitch -> ContextSwitch -> ContextSwitch # min :: ContextSwitch -> ContextSwitch -> ContextSwitch #
Read ContextSwitch Source # |
Methods readsPrec :: Int -> ReadS ContextSwitch # readList :: ReadS [ContextSwitch] # readPrec :: ReadPrec ContextSwitch # readListPrec :: ReadPrec [ContextSwitch] #
Show ContextSwitch Source # |
Methods showsPrec :: Int -> ContextSwitch -> ShowS # show :: ContextSwitch -> String # showList :: [ContextSwitch] -> ShowS #
Generic ContextSwitch Source # |
Associated Types type Rep ContextSwitch :: * -> * # Methods from :: ContextSwitch -> Rep ContextSwitch x # to :: Rep ContextSwitch x -> ContextSwitch #
Binary ContextSwitch Source # |
Methods put :: ContextSwitch -> Put # get :: Get ContextSwitch # putList :: [ContextSwitch] -> Put #
type Rep ContextSwitch Source # |
type Rep ContextSwitch = D1 (MetaData "ContextSwitch" "Skylighting.Types" "skylighting-0.3.3.1-AsHtinoWKN3LkTvrtcdLM" False) ((:+:) (C1 (MetaCons "Pop" PrefixI False) U1) (C1 (MetaCons "Push" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ContextName))))

data Syntax Source #

A syntax corresponds to a complete Kate syntax description. The `sShortname` field is derived from the filename.

Constructors

Syntax |

Fields

- sName :: Text
- sFilename :: String
- sShortname :: Text
- sContexts :: Map Text Context
- sAuthor :: Text
- sVersion :: Text
- sLicense :: Text
- sExtensions :: [String]
- sStartingContext :: Text

Instances

Eq Syntax Source # |
Methods (==) :: Syntax -> Syntax -> Bool # (/=) :: Syntax -> Syntax -> Bool #
Data Syntax Source # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Syntax -> c Syntax #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Syntax #

toConstr :: Syntax -> Constr #

dataTypeOf :: Syntax -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Syntax) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Syntax) #

gmapT :: (forall b. Data b => b -> b) -> Syntax -> Syntax #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Syntax -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Syntax -> r #

gmapQ :: (forall d. Data d => d -> u) -> Syntax -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Syntax -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Syntax -> m Syntax #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Syntax -> m Syntax #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Syntax -> m Syntax #

Ord Syntax Source # |
Methods compare :: Syntax -> Syntax -> Ordering # (<) :: Syntax -> Syntax -> Bool # (<=) :: Syntax -> Syntax -> Bool # (>) :: Syntax -> Syntax -> Bool # (>=) :: Syntax -> Syntax -> Bool # max :: Syntax -> Syntax -> Syntax # min :: Syntax -> Syntax -> Syntax #
Read Syntax Source # |
Methods readsPrec :: Int -> ReadS Syntax # readList :: ReadS [Syntax] # readPrec :: ReadPrec Syntax # readListPrec :: ReadPrec [Syntax] #
Show Syntax Source # |
Methods showsPrec :: Int -> Syntax -> ShowS # show :: Syntax -> String # showList :: [Syntax] -> ShowS #
Generic Syntax Source # |
Associated Types type Rep Syntax :: * -> * # Methods from :: Syntax -> Rep Syntax x # to :: Rep Syntax x -> Syntax #
Binary Syntax Source # |
Methods put :: Syntax -> Put # get :: Get Syntax # putList :: [Syntax] -> Put #
type Rep Syntax Source # |

type Rep Syntax = D1 (MetaData "Syntax" "Skylighting.Types" "skylighting-0.3.3.1-AsHtinoWKN3LkTvrtcdLM" False) (C1 (MetaCons "Syntax" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "sName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) (S1 (MetaSel (Just Symbol "sFilename") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))) ((:*:) (S1 (MetaSel (Just Symbol "sShortname") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) (S1 (MetaSel (Just Symbol "sContexts") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map Text Context))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "sAuthor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) (S1 (MetaSel (Just Symbol "sVersion") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text))) ((:*:) (S1 (MetaSel (Just Symbol "sLicense") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) ((:*:) (S1 (MetaSel (Just Symbol "sExtensions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String])) (S1 (MetaSel (Just Symbol "sStartingContext") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))))))

type SyntaxMap = Map Text Syntax Source #

A map of syntaxes, keyed by full name.

# Tokens

type Token = (TokenType, Text) Source #

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

data TokenType Source #

`KeywordTok` corresponds to `dsKeyword` in Kate syntax descriptions, and so on.

Constructors

KeywordTok |
DataTypeTok |
DecValTok |
BaseNTok |
FloatTok |
ConstantTok |
CharTok |
SpecialCharTok |
StringTok |
VerbatimStringTok |
SpecialStringTok |
ImportTok |
CommentTok |
DocumentationTok |
AnnotationTok |
CommentVarTok |
OtherTok |
FunctionTok |
VariableTok |
ControlFlowTok |
OperatorTok |
BuiltInTok |
ExtensionTok |
PreprocessorTok |
AttributeTok |
RegionMarkerTok |
InformationTok |
WarningTok |
AlertTok |
ErrorTok |
NormalTok |

Instances

Enum TokenType Source # |
Methods succ :: TokenType -> TokenType # pred :: TokenType -> TokenType # toEnum :: Int -> TokenType # fromEnum :: TokenType -> Int # enumFrom :: TokenType -> [TokenType] # enumFromThen :: TokenType -> TokenType -> [TokenType] # enumFromTo :: TokenType -> TokenType -> [TokenType] # enumFromThenTo :: TokenType -> TokenType -> TokenType -> [TokenType] #
Eq TokenType Source # |
Methods (==) :: TokenType -> TokenType -> Bool # (/=) :: TokenType -> TokenType -> Bool #
Data TokenType Source # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TokenType -> c TokenType #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TokenType #

toConstr :: TokenType -> Constr #

dataTypeOf :: TokenType -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c TokenType) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TokenType) #

gmapT :: (forall b. Data b => b -> b) -> TokenType -> TokenType #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TokenType -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TokenType -> r #

gmapQ :: (forall d. Data d => d -> u) -> TokenType -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TokenType -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TokenType -> m TokenType #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TokenType -> m TokenType #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TokenType -> m TokenType #

Ord TokenType Source # |
Methods compare :: TokenType -> TokenType -> Ordering # (<) :: TokenType -> TokenType -> Bool # (<=) :: TokenType -> TokenType -> Bool # (>) :: TokenType -> TokenType -> Bool # (>=) :: TokenType -> TokenType -> Bool # max :: TokenType -> TokenType -> TokenType # min :: TokenType -> TokenType -> TokenType #
Read TokenType Source # |
Methods readsPrec :: Int -> ReadS TokenType # readList :: ReadS [TokenType] # readPrec :: ReadPrec TokenType # readListPrec :: ReadPrec [TokenType] #
Show TokenType Source # |
Methods showsPrec :: Int -> TokenType -> ShowS # show :: TokenType -> String # showList :: [TokenType] -> ShowS #
Generic TokenType Source # |
Associated Types type Rep TokenType :: * -> * # Methods from :: TokenType -> Rep TokenType x # to :: Rep TokenType x -> TokenType #
FromJSON TokenType Source # | JSON `Keyword` corresponds to `KeywordTok`, and so on.
Methods parseJSON :: Value -> Parser TokenType # parseJSONList :: Value -> Parser [TokenType] #
Binary TokenType Source # |
Methods put :: TokenType -> Put # get :: Get TokenType # putList :: [TokenType] -> Put #
type Rep TokenType Source # |

type Rep TokenType = D1 (MetaData "TokenType" "Skylighting.Types" "skylighting-0.3.3.1-AsHtinoWKN3LkTvrtcdLM" False) ((:+:) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "KeywordTok" PrefixI False) U1) ((:+:) (C1 (MetaCons "DataTypeTok" PrefixI False) U1) (C1 (MetaCons "DecValTok" PrefixI False) U1))) ((:+:) ((:+:) (C1 (MetaCons "BaseNTok" PrefixI False) U1) (C1 (MetaCons "FloatTok" PrefixI False) U1)) ((:+:) (C1 (MetaCons "ConstantTok" PrefixI False) U1) (C1 (MetaCons "CharTok" PrefixI False) U1)))) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "SpecialCharTok" PrefixI False) U1) (C1 (MetaCons "StringTok" PrefixI False) U1)) ((:+:) (C1 (MetaCons "VerbatimStringTok" PrefixI False) U1) (C1 (MetaCons "SpecialStringTok" PrefixI False) U1))) ((:+:) ((:+:) (C1 (MetaCons "ImportTok" PrefixI False) U1) (C1 (MetaCons "CommentTok" PrefixI False) U1)) ((:+:) (C1 (MetaCons "DocumentationTok" PrefixI False) U1) (C1 (MetaCons "AnnotationTok" PrefixI False) U1))))) ((:+:) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "CommentVarTok" PrefixI False) U1) (C1 (MetaCons "OtherTok" PrefixI False) U1)) ((:+:) (C1 (MetaCons "FunctionTok" PrefixI False) U1) (C1 (MetaCons "VariableTok" PrefixI False) U1))) ((:+:) ((:+:) (C1 (MetaCons "ControlFlowTok" PrefixI False) U1) (C1 (MetaCons "OperatorTok" PrefixI False) U1)) ((:+:) (C1 (MetaCons "BuiltInTok" PrefixI False) U1) (C1 (MetaCons "ExtensionTok" PrefixI False) U1)))) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "PreprocessorTok" PrefixI False) U1) (C1 (MetaCons "AttributeTok" PrefixI False) U1)) ((:+:) (C1 (MetaCons "RegionMarkerTok" PrefixI False) U1) (C1 (MetaCons "InformationTok" PrefixI False) U1))) ((:+:) ((:+:) (C1 (MetaCons "WarningTok" PrefixI False) U1) (C1 (MetaCons "AlertTok" PrefixI False) U1)) ((:+:) (C1 (MetaCons "ErrorTok" PrefixI False) U1) (C1 (MetaCons "NormalTok" PrefixI False) U1))))))

type SourceLine = [Token] Source #

A line of source: a list of labeled tokens.

# Styles

data TokenStyle Source #

A `TokenStyle` determines how a token is to be rendered.

Constructors

TokenStyle |

Fields

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

Instances

Eq TokenStyle Source # |
Methods (==) :: TokenStyle -> TokenStyle -> Bool # (/=) :: TokenStyle -> TokenStyle -> Bool #
Data TokenStyle Source # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TokenStyle -> c TokenStyle #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TokenStyle #

toConstr :: TokenStyle -> Constr #

dataTypeOf :: TokenStyle -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c TokenStyle) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TokenStyle) #

gmapT :: (forall b. Data b => b -> b) -> TokenStyle -> TokenStyle #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TokenStyle -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TokenStyle -> r #

gmapQ :: (forall d. Data d => d -> u) -> TokenStyle -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TokenStyle -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TokenStyle -> m TokenStyle #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TokenStyle -> m TokenStyle #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TokenStyle -> m TokenStyle #

Ord TokenStyle Source # |
Methods compare :: TokenStyle -> TokenStyle -> Ordering # (<) :: TokenStyle -> TokenStyle -> Bool # (<=) :: TokenStyle -> TokenStyle -> Bool # (>) :: TokenStyle -> TokenStyle -> Bool # (>=) :: TokenStyle -> TokenStyle -> Bool # max :: TokenStyle -> TokenStyle -> TokenStyle # min :: TokenStyle -> TokenStyle -> TokenStyle #
Read TokenStyle Source # |
Methods readsPrec :: Int -> ReadS TokenStyle # readList :: ReadS [TokenStyle] # readPrec :: ReadPrec TokenStyle # readListPrec :: ReadPrec [TokenStyle] #
Show TokenStyle Source # |
Methods showsPrec :: Int -> TokenStyle -> ShowS # show :: TokenStyle -> String # showList :: [TokenStyle] -> ShowS #
Generic TokenStyle Source # |
Associated Types type Rep TokenStyle :: * -> * # Methods from :: TokenStyle -> Rep TokenStyle x # to :: Rep TokenStyle x -> TokenStyle #
FromJSON TokenStyle Source # | The keywords used in KDE syntax themes are used, e.g. `text-color` for default token color.
Methods parseJSON :: Value -> Parser TokenStyle # parseJSONList :: Value -> Parser [TokenStyle] #
Binary TokenStyle Source # |
Methods put :: TokenStyle -> Put # get :: Get TokenStyle # putList :: [TokenStyle] -> Put #
type Rep TokenStyle Source # |

type Rep TokenStyle = D1 (MetaData "TokenStyle" "Skylighting.Types" "skylighting-0.3.3.1-AsHtinoWKN3LkTvrtcdLM" False) (C1 (MetaCons "TokenStyle" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "tokenColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Color))) (S1 (MetaSel (Just Symbol "tokenBackground") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Color)))) ((:*:) (S1 (MetaSel (Just Symbol "tokenBold") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) ((:*:) (S1 (MetaSel (Just Symbol "tokenItalic") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) (S1 (MetaSel (Just Symbol "tokenUnderline") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool))))))

defStyle :: TokenStyle Source #

Default style.

data Color Source #

A color (redgreenblue).

Constructors

RGB Word8 Word8 Word8 |

Instances

Eq Color Source # |
Methods (==) :: Color -> Color -> Bool # (/=) :: Color -> Color -> Bool #
Data Color Source # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Color -> c Color #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Color #

toConstr :: Color -> Constr #

dataTypeOf :: Color -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Color) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Color) #

gmapT :: (forall b. Data b => b -> b) -> Color -> Color #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Color -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Color -> r #

gmapQ :: (forall d. Data d => d -> u) -> Color -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Color -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Color -> m Color #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Color -> m Color #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Color -> m Color #

Ord Color Source # |
Methods compare :: Color -> Color -> Ordering # (<) :: Color -> Color -> Bool # (<=) :: Color -> Color -> Bool # (>) :: Color -> Color -> Bool # (>=) :: Color -> Color -> Bool # max :: Color -> Color -> Color # min :: Color -> Color -> Color #
Read Color Source # |
Methods readsPrec :: Int -> ReadS Color # readList :: ReadS [Color] # readPrec :: ReadPrec Color # readListPrec :: ReadPrec [Color] #
Show Color Source # |
Methods showsPrec :: Int -> Color -> ShowS # show :: Color -> String # showList :: [Color] -> ShowS #
Generic Color Source # |
Associated Types type Rep Color :: * -> * # Methods from :: Color -> Rep Color x # to :: Rep Color x -> Color #
FromJSON Color Source # | JSON `"#1aff2b" corresponds to the color` RGB 0x1a 0xff 0x2b@.
Methods parseJSON :: Value -> Parser Color # parseJSONList :: Value -> Parser [Color] #
Binary Color Source # |
Methods put :: Color -> Put # get :: Get Color # putList :: [Color] -> Put #
type Rep Color Source # |

type Rep Color = D1 (MetaData "Color" "Skylighting.Types" "skylighting-0.3.3.1-AsHtinoWKN3LkTvrtcdLM" False) (C1 (MetaCons "RGB" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8)))))

class ToColor a where Source #

Things that can be converted to a color.

Minimal complete definition

toColor

Methods

toColor :: a -> Maybe Color Source #

Instances

ToColor Int Source # |
Methods toColor :: Int -> Maybe Color Source #
ToColor String Source # |
Methods toColor :: String -> Maybe Color Source #
ToColor (Double, Double, Double) Source # |
Methods toColor :: (Double, Double, Double) -> Maybe Color Source #
ToColor (Word8, Word8, Word8) Source # |
Methods toColor :: (Word8, Word8, Word8) -> Maybe Color Source #

class FromColor a where Source #

Different representations of a `Color`.

Minimal complete definition

fromColor

Methods

fromColor :: Color -> a Source #

Instances

FromColor String Source # |
Methods fromColor :: Color -> String Source #
FromColor (Double, Double, Double) Source # |
Methods fromColor :: Color -> (Double, Double, Double) Source #
FromColor (Word8, Word8, Word8) Source # |
Methods fromColor :: Color -> (Word8, Word8, Word8) Source #

data Style Source #

A rendering style. This determines how each kind of token is to be rendered, and sets a default color and background color for normal tokens. Line numbers can have a different color and background color.

Constructors

Style |

Fields

- tokenStyles :: [(TokenType, TokenStyle)]
- defaultColor :: Maybe Color
- backgroundColor :: Maybe Color
- lineNumberColor :: Maybe Color
- lineNumberBackgroundColor :: Maybe Color

Instances

Eq Style Source # |
Methods (==) :: Style -> Style -> Bool # (/=) :: Style -> Style -> Bool #
Data Style Source # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Style -> c Style #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Style #

toConstr :: Style -> Constr #

dataTypeOf :: Style -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Style) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Style) #

gmapT :: (forall b. Data b => b -> b) -> Style -> Style #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Style -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Style -> r #

gmapQ :: (forall d. Data d => d -> u) -> Style -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Style -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Style -> m Style #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Style -> m Style #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Style -> m Style #

Ord Style Source # |
Methods compare :: Style -> Style -> Ordering # (<) :: Style -> Style -> Bool # (<=) :: Style -> Style -> Bool # (>) :: Style -> Style -> Bool # (>=) :: Style -> Style -> Bool # max :: Style -> Style -> Style # min :: Style -> Style -> Style #
Read Style Source # |
Methods readsPrec :: Int -> ReadS Style # readList :: ReadS [Style] # readPrec :: ReadPrec Style # readListPrec :: ReadPrec [Style] #
Show Style Source # |
Methods showsPrec :: Int -> Style -> ShowS # show :: Style -> String # showList :: [Style] -> ShowS #
Generic Style Source # |
Associated Types type Rep Style :: * -> * # Methods from :: Style -> Rep Style x # to :: Rep Style x -> Style #
FromJSON Style Source # | The FromJSON instance for `Style` is designed so that a KDE syntax theme (JSON) can be decoded directly as a `Style`.
Methods parseJSON :: Value -> Parser Style # parseJSONList :: Value -> Parser [Style] #
Binary Style Source # |
Methods put :: Style -> Put # get :: Get Style # putList :: [Style] -> Put #
type Rep Style Source # |

type Rep Style = D1 (MetaData "Style" "Skylighting.Types" "skylighting-0.3.3.1-AsHtinoWKN3LkTvrtcdLM" False) (C1 (MetaCons "Style" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "tokenStyles") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(TokenType, TokenStyle)])) (S1 (MetaSel (Just Symbol "defaultColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Color)))) ((:*:) (S1 (MetaSel (Just Symbol "backgroundColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Color))) ((:*:) (S1 (MetaSel (Just Symbol "lineNumberColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Color))) (S1 (MetaSel (Just Symbol "lineNumberBackgroundColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Color)))))))

# Format options

data FormatOptions Source #

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 :: [Text]

  Additional classes for Html code tag

- containerClasses :: [Text]

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

Instances

Eq FormatOptions Source # |
Methods (==) :: FormatOptions -> FormatOptions -> Bool # (/=) :: FormatOptions -> FormatOptions -> Bool #
Data FormatOptions Source # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FormatOptions -> c FormatOptions #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FormatOptions #

toConstr :: FormatOptions -> Constr #

dataTypeOf :: FormatOptions -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c FormatOptions) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FormatOptions) #

gmapT :: (forall b. Data b => b -> b) -> FormatOptions -> FormatOptions #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FormatOptions -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FormatOptions -> r #

gmapQ :: (forall d. Data d => d -> u) -> FormatOptions -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> FormatOptions -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> FormatOptions -> m FormatOptions #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FormatOptions -> m FormatOptions #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FormatOptions -> m FormatOptions #

Ord FormatOptions Source # |
Methods compare :: FormatOptions -> FormatOptions -> Ordering # (<) :: FormatOptions -> FormatOptions -> Bool # (<=) :: FormatOptions -> FormatOptions -> Bool # (>) :: FormatOptions -> FormatOptions -> Bool # (>=) :: FormatOptions -> FormatOptions -> Bool # max :: FormatOptions -> FormatOptions -> FormatOptions # min :: FormatOptions -> FormatOptions -> FormatOptions #
Read FormatOptions Source # |
Methods readsPrec :: Int -> ReadS FormatOptions # readList :: ReadS [FormatOptions] # readPrec :: ReadPrec FormatOptions # readListPrec :: ReadPrec [FormatOptions] #
Show FormatOptions Source # |
Methods showsPrec :: Int -> FormatOptions -> ShowS # show :: FormatOptions -> String # showList :: [FormatOptions] -> ShowS #
Generic FormatOptions Source # |
Associated Types type Rep FormatOptions :: * -> * # Methods from :: FormatOptions -> Rep FormatOptions x # to :: Rep FormatOptions x -> FormatOptions #
Binary FormatOptions Source # |
Methods put :: FormatOptions -> Put # get :: Get FormatOptions # putList :: [FormatOptions] -> Put #
type Rep FormatOptions Source # |

type Rep FormatOptions = D1 (MetaData "FormatOptions" "Skylighting.Types" "skylighting-0.3.3.1-AsHtinoWKN3LkTvrtcdLM" False) (C1 (MetaCons "FormatOptions" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "numberLines") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) ((:*:) (S1 (MetaSel (Just Symbol "startNumber") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)) (S1 (MetaSel (Just Symbol "lineAnchors") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))) ((:*:) (S1 (MetaSel (Just Symbol "titleAttributes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) ((:*:) (S1 (MetaSel (Just Symbol "codeClasses") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Text])) (S1 (MetaSel (Just Symbol "containerClasses") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Text]))))))

defaultFormatOpts :: FormatOptions Source #

Default formatting options.