Lookup syntax by (in order) full name (case insensitive), short name (case insensitive), extension.
Moduleskylighting-0.15Haskell2010
Skylighting
- 22 types
- 2 classes
- 50 values
- Packageskylighting-0.15
- Exports75
- LanguageHaskell2010
- LicenceGPL-2.0-only
- SourceCore.hs
Lookup a syntax by full name (case insensitive).
Lookup a syntax by short name (case insensitive).
Returns a list of syntaxes appropriate for the given file extension.
Returns a list of syntaxes appropriate for the given filename.
module Skylighting.Syntax
Default style.
Default formatting options.
Test for membership in a WordSet.
A set of words to match (either case-sensitive or case-insensitive).
The available levels of color complexity in ANSI terminal output.
Constructors
ANSI16Color16-color mode
ANSI256Color256-color mode
ANSITrueColorTrue-color mode
Instances10Bounded, Enum, Eq, Data, Ord, Read, …
Bounded ANSIColorLevelDefined in skylighting-core-0.15 · Skylighting.TypesEnum ANSIColorLevelDefined in skylighting-core-0.15 · Skylighting.TypesEq ANSIColorLevelDefined in skylighting-core-0.15 · Skylighting.TypesData ANSIColorLevelDefined in skylighting-core-0.15 · Skylighting.TypesOrd ANSIColorLevelDefined in skylighting-core-0.15 · Skylighting.TypesRead ANSIColorLevelDefined in skylighting-core-0.15 · Skylighting.TypesShow ANSIColorLevelDefined in skylighting-core-0.15 · Skylighting.TypesGeneric ANSIColorLevelDefined in skylighting-core-0.15 · Skylighting.TypesBinary ANSIColorLevelDefined in skylighting-core-0.15 · Skylighting.Typestype Rep ANSIColorLevel = D1 ('MetaDataDefined in skylighting-core-0.15 · Skylighting.Types"ANSIColorLevel"
"Skylighting.Types"
"skylighting-core-0.15-FF2LhjzpZ2i5WHVNZhqtEA"
'False) (C1 ('MetaCons"ANSI16Color"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"ANSI256Color"
'PrefixI 'False) U1 :+: C1 ('MetaCons"ANSITrueColor"
'PrefixI 'False) U1))
Instances10Eq, Data, Ord, Read, Show, Generic, …
Eq ColorDefined in skylighting-core-0.15 · Skylighting.TypesData ColorDefined in skylighting-core-0.15 · Skylighting.TypesOrd ColorDefined in skylighting-core-0.15 · Skylighting.TypesRead ColorDefined in skylighting-core-0.15 · Skylighting.TypesShow ColorDefined in skylighting-core-0.15 · Skylighting.TypesGeneric ColorDefined in skylighting-core-0.15 · Skylighting.TypesBinary ColorDefined in skylighting-core-0.15 · Skylighting.TypesFromJSON ColorDefined in skylighting-core-0.15 · Skylighting.TypesJSON
"#1aff2b"corresponds to the colorRGB 0x1a 0xff 0x2b.ToJSON ColorDefined in skylighting-core-0.15 · Skylighting.Typestype Rep Color = D1 ('MetaDataDefined in skylighting-core-0.15 · Skylighting.Types"Color"
"Skylighting.Types"
"skylighting-core-0.15-FF2LhjzpZ2i5WHVNZhqtEA"
'False) (C1 ('MetaCons"RGB"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedUnpack) (Rec0 Word8) :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedUnpack) (Rec0 Word8) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedUnpack) (Rec0 Word8))))
A Context corresponds to a context element in a Kate syntax description.
Constructors
ContextcName :: !TextcSyntax :: !TextcRules :: ![Rule]cAttribute :: !TokenTypecLineEmptyContext :: ![ContextSwitch]cLineEndContext :: ![ContextSwitch]cFallthrough :: !BoolcFallthroughContext :: ![ContextSwitch]cDynamic :: !Bool
Instances8Eq, Data, Ord, Read, Show, Generic, …
Eq ContextDefined in skylighting-core-0.15 · Skylighting.TypesData ContextDefined in skylighting-core-0.15 · Skylighting.TypesOrd ContextDefined in skylighting-core-0.15 · Skylighting.TypesRead ContextDefined in skylighting-core-0.15 · Skylighting.TypesShow ContextDefined in skylighting-core-0.15 · Skylighting.TypesGeneric ContextDefined in skylighting-core-0.15 · Skylighting.TypesBinary ContextDefined in skylighting-core-0.15 · Skylighting.Typestype Rep Context = D1 ('MetaDataDefined in skylighting-core-0.15 · Skylighting.Types"Context"
"Skylighting.Types"
"skylighting-core-0.15-FF2LhjzpZ2i5WHVNZhqtEA"
'False) (C1 ('MetaCons"Context"
'PrefixI 'True) (((S1 ('MetaSel ('Just"cName"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just"cSyntax"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just"cRules"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Rule]) :*: S1 ('MetaSel ('Just"cAttribute"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TokenType))) :*: ((S1 ('MetaSel ('Just"cLineEmptyContext"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [ContextSwitch]) :*: S1 ('MetaSel ('Just"cLineEndContext"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [ContextSwitch])) :*: (S1 ('MetaSel ('Just"cFallthrough"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: (S1 ('MetaSel ('Just"cFallthroughContext"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [ContextSwitch]) :*: S1 ('MetaSel ('Just"cDynamic"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool))))))
Full name of a context: the first member of the pair is the full syntax name, the second the context name within that syntax.
A context switch, either pops or pushes a context.
Constructors
Instances8Eq, Data, Ord, Read, Show, Generic, …
Eq ContextSwitchDefined in skylighting-core-0.15 · Skylighting.TypesData ContextSwitchDefined in skylighting-core-0.15 · Skylighting.TypesOrd ContextSwitchDefined in skylighting-core-0.15 · Skylighting.TypesRead ContextSwitchDefined in skylighting-core-0.15 · Skylighting.TypesShow ContextSwitchDefined in skylighting-core-0.15 · Skylighting.TypesGeneric ContextSwitchDefined in skylighting-core-0.15 · Skylighting.TypesBinary ContextSwitchDefined in skylighting-core-0.15 · Skylighting.Typestype Rep ContextSwitch = D1 ('MetaDataDefined in skylighting-core-0.15 · Skylighting.Types"ContextSwitch"
"Skylighting.Types"
"skylighting-core-0.15-FF2LhjzpZ2i5WHVNZhqtEA"
'False) (C1 ('MetaCons"Pop"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Push"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ContextName)))
Options for formatting source code.
Constructors
FormatOptionsnumberLines :: !BoolNumber lines
startNumber :: !IntNumber of first line
lineAnchors :: !BoolAnchors on each line number
titleAttributes :: !BoolHtml titles with token types
codeClasses :: ![Text]Additional classes for Html code tag
containerClasses :: ![Text]Additional classes for Html container tag
lineIdPrefix :: !TextPrefix for id attributes on lines
ansiColorLevel :: !ANSIColorLevelLevel of ANSI color support to use
Instances8Eq, Data, Ord, Read, Show, Generic, …
Eq FormatOptionsDefined in skylighting-core-0.15 · Skylighting.TypesData FormatOptionsDefined in skylighting-core-0.15 · Skylighting.TypesOrd FormatOptionsDefined in skylighting-core-0.15 · Skylighting.TypesRead FormatOptionsDefined in skylighting-core-0.15 · Skylighting.TypesShow FormatOptionsDefined in skylighting-core-0.15 · Skylighting.TypesGeneric FormatOptionsDefined in skylighting-core-0.15 · Skylighting.TypesBinary FormatOptionsDefined in skylighting-core-0.15 · Skylighting.Typestype Rep FormatOptions = D1 ('MetaDataDefined in skylighting-core-0.15 · Skylighting.Types"FormatOptions"
"Skylighting.Types"
"skylighting-core-0.15-FF2LhjzpZ2i5WHVNZhqtEA"
'False) (C1 ('MetaCons"FormatOptions"
'PrefixI 'True) (((S1 ('MetaSel ('Just"numberLines"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just"startNumber"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int)) :*: (S1 ('MetaSel ('Just"lineAnchors"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just"titleAttributes"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool))) :*: ((S1 ('MetaSel ('Just"codeClasses"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Text]) :*: S1 ('MetaSel ('Just"containerClasses"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Text])) :*: (S1 ('MetaSel ('Just"lineIdPrefix"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just"ansiColorLevel"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ANSIColorLevel)))))
Instances6FromColor
FromColor StringDefined in skylighting-core-0.15 · Skylighting.TypesFromColor Xterm256ColorCodeDefined in skylighting-format-ansi-0.1 · Skylighting.Format.ANSIWarning: this conversion is noticeably approximate!
(Ord a, Floating a) => FromColor (Colour a)Defined in skylighting-core-0.15 · Skylighting.TypesFromColor (ColorIntensity, Color)Defined in skylighting-format-ansi-0.1 · Skylighting.Format.ANSI · orphanWarning: this conversion is extremely approximate!
FromColor (Double, Double, Double)Defined in skylighting-core-0.15 · Skylighting.TypesFromColor (Word8, Word8, Word8)Defined in skylighting-core-0.15 · Skylighting.Types
Attributes controlling how keywords are interpreted.
Constructors
Instances8Eq, Data, Ord, Read, Show, Generic, …
Eq KeywordAttrDefined in skylighting-core-0.15 · Skylighting.TypesData KeywordAttrDefined in skylighting-core-0.15 · Skylighting.TypesOrd KeywordAttrDefined in skylighting-core-0.15 · Skylighting.TypesRead KeywordAttrDefined in skylighting-core-0.15 · Skylighting.TypesShow KeywordAttrDefined in skylighting-core-0.15 · Skylighting.TypesGeneric KeywordAttrDefined in skylighting-core-0.15 · Skylighting.TypesBinary KeywordAttrDefined in skylighting-core-0.15 · Skylighting.Typestype Rep KeywordAttr = D1 ('MetaDataDefined in skylighting-core-0.15 · Skylighting.Types"KeywordAttr"
"Skylighting.Types"
"skylighting-core-0.15-FF2LhjzpZ2i5WHVNZhqtEA"
'False) (C1 ('MetaCons"KeywordAttr"
'PrefixI 'True) (S1 ('MetaSel ('Just"keywordCaseSensitive"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just"keywordDelims"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set Char))))
A list item is either just a textual value or an included list. IncludeList (x,y) includes list y from syntax with full name x.
Constructors
Item !TextIncludeList !(Text, Text)
Instances8Eq, Data, Ord, Read, Show, Generic, …
Eq ListItemDefined in skylighting-core-0.15 · Skylighting.TypesData ListItemDefined in skylighting-core-0.15 · Skylighting.TypesOrd ListItemDefined in skylighting-core-0.15 · Skylighting.TypesRead ListItemDefined in skylighting-core-0.15 · Skylighting.TypesShow ListItemDefined in skylighting-core-0.15 · Skylighting.TypesGeneric ListItemDefined in skylighting-core-0.15 · Skylighting.TypesBinary ListItemDefined in skylighting-core-0.15 · Skylighting.Typestype Rep ListItem = D1 ('MetaDataDefined in skylighting-core-0.15 · Skylighting.Types"ListItem"
"Skylighting.Types"
"skylighting-core-0.15-FF2LhjzpZ2i5WHVNZhqtEA"
'False) (C1 ('MetaCons"Item"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :+: C1 ('MetaCons"IncludeList"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Text, Text))))
Matchers correspond to the element types in a context.
Instances8Eq, Data, Ord, Read, Show, Generic, …
Eq MatcherDefined in skylighting-core-0.15 · Skylighting.TypesData MatcherDefined in skylighting-core-0.15 · Skylighting.TypesOrd MatcherDefined in skylighting-core-0.15 · Skylighting.TypesRead MatcherDefined in skylighting-core-0.15 · Skylighting.TypesShow MatcherDefined in skylighting-core-0.15 · Skylighting.TypesGeneric MatcherDefined in skylighting-core-0.15 · Skylighting.TypesBinary MatcherDefined in skylighting-core-0.15 · Skylighting.Typestype Rep Matcher = D1 ('MetaDataDefined in skylighting-core-0.15 · Skylighting.Types"Matcher"
"Skylighting.Types"
"skylighting-core-0.15-FF2LhjzpZ2i5WHVNZhqtEA"
'False) ((((C1 ('MetaCons"DetectChar"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Char)) :+: C1 ('MetaCons"Detect2Chars"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Char) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Char))) :+: (C1 ('MetaCons"AnyChar"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set Char))) :+: C1 ('MetaCons"RangeDetect"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Char) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Char)))) :+: ((C1 ('MetaCons"StringDetect"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :+: C1 ('MetaCons"WordDetect"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))) :+: (C1 ('MetaCons"RegExpr"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RE)) :+: (C1 ('MetaCons"Keyword"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 KeywordAttr) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Either Text (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) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Char))) :+: (C1 ('MetaCons"IncludeRules"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ContextName)) :+: (C1 ('MetaCons"DetectSpaces"
'PrefixI 'False) U1 :+: C1 ('MetaCons"DetectIdentifier"
'PrefixI 'False) U1)))))
A rule corresponds to one of the elements of a Kate syntax highlighting "context."
Constructors
RulerMatcher :: !MatcherrAttribute :: !TokenTyperIncludeAttribute :: !BoolrWordDelimiters :: Set CharrDynamic :: !BoolrCaseSensitive :: !BoolrChildren :: ![Rule]rLookahead :: !BoolrFirstNonspace :: !BoolrColumn :: !Maybe IntrContextSwitch :: ![ContextSwitch]
Instances8Eq, Data, Ord, Read, Show, Generic, …
Eq RuleDefined in skylighting-core-0.15 · Skylighting.TypesData RuleDefined in skylighting-core-0.15 · Skylighting.TypesOrd RuleDefined in skylighting-core-0.15 · Skylighting.TypesRead RuleDefined in skylighting-core-0.15 · Skylighting.TypesShow RuleDefined in skylighting-core-0.15 · Skylighting.TypesGeneric RuleDefined in skylighting-core-0.15 · Skylighting.TypesBinary RuleDefined in skylighting-core-0.15 · Skylighting.Typestype Rep Rule = D1 ('MetaDataDefined in skylighting-core-0.15 · Skylighting.Types"Rule"
"Skylighting.Types"
"skylighting-core-0.15-FF2LhjzpZ2i5WHVNZhqtEA"
'False) (C1 ('MetaCons"Rule"
'PrefixI 'True) (((S1 ('MetaSel ('Just"rMatcher"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Matcher) :*: S1 ('MetaSel ('Just"rAttribute"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TokenType)) :*: (S1 ('MetaSel ('Just"rIncludeAttribute"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: (S1 ('MetaSel ('Just"rWordDelimiters"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Set Char)) :*: S1 ('MetaSel ('Just"rDynamic"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)))) :*: ((S1 ('MetaSel ('Just"rCaseSensitive"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: (S1 ('MetaSel ('Just"rChildren"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Rule]) :*: S1 ('MetaSel ('Just"rLookahead"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool))) :*: (S1 ('MetaSel ('Just"rFirstNonspace"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: (S1 ('MetaSel ('Just"rColumn"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just"rContextSwitch"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [ContextSwitch]))))))
A line of source: a list of labeled tokens.
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
Instances10Eq, Data, Ord, Read, Show, Generic, …
Eq StyleDefined in skylighting-core-0.15 · Skylighting.TypesData StyleDefined in skylighting-core-0.15 · Skylighting.TypesOrd StyleDefined in skylighting-core-0.15 · Skylighting.TypesRead StyleDefined in skylighting-core-0.15 · Skylighting.TypesShow StyleDefined in skylighting-core-0.15 · Skylighting.TypesGeneric StyleDefined in skylighting-core-0.15 · Skylighting.TypesBinary StyleDefined in skylighting-core-0.15 · Skylighting.TypesFromJSON StyleDefined in skylighting-core-0.15 · Skylighting.TypesToJSON StyleDefined in skylighting-core-0.15 · Skylighting.Typestype Rep Style = D1 ('MetaDataDefined in skylighting-core-0.15 · Skylighting.Types"Style"
"Skylighting.Types"
"skylighting-core-0.15-FF2LhjzpZ2i5WHVNZhqtEA"
'False) (C1 ('MetaCons"Style"
'PrefixI 'True) ((S1 ('MetaSel ('Just"tokenStyles"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map TokenType TokenStyle)) :*: S1 ('MetaSel ('Just"defaultColor"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Color))) :*: (S1 ('MetaSel ('Just"backgroundColor"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Color)) :*: (S1 ('MetaSel ('Just"lineNumberColor"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Color)) :*: S1 ('MetaSel ('Just"lineNumberBackgroundColor"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Color))))))
A syntax corresponds to a complete Kate syntax description. The sShortname field is derived from the filename.
Instances8Eq, Data, Ord, Read, Show, Generic, …
Eq SyntaxDefined in skylighting-core-0.15 · Skylighting.TypesData SyntaxDefined in skylighting-core-0.15 · Skylighting.TypesOrd SyntaxDefined in skylighting-core-0.15 · Skylighting.TypesRead SyntaxDefined in skylighting-core-0.15 · Skylighting.TypesShow SyntaxDefined in skylighting-core-0.15 · Skylighting.TypesGeneric SyntaxDefined in skylighting-core-0.15 · Skylighting.TypesBinary SyntaxDefined in skylighting-core-0.15 · Skylighting.Typestype Rep Syntax = D1 ('MetaDataDefined in skylighting-core-0.15 · Skylighting.Types"Syntax"
"Skylighting.Types"
"skylighting-core-0.15-FF2LhjzpZ2i5WHVNZhqtEA"
'False) (C1 ('MetaCons"Syntax"
'PrefixI 'True) (((S1 ('MetaSel ('Just"sName"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just"sFilename"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String)) :*: (S1 ('MetaSel ('Just"sShortname"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just"sLists"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map Text [ListItem])) :*: S1 ('MetaSel ('Just"sContexts"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map Text Context))))) :*: ((S1 ('MetaSel ('Just"sAuthor"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just"sVersion"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just"sLicense"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just"sExtensions"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [String]) :*: S1 ('MetaSel ('Just"sStartingContext"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))))))
A map of syntaxes, keyed by full name.
Instances7ToColor, …
ToColor StringDefined in skylighting-core-0.15 · Skylighting.TypesToColor IntDefined in skylighting-core-0.15 · Skylighting.TypesToColor Xterm256ColorCodeDefined in skylighting-format-ansi-0.1 · Skylighting.Format.ANSI(RealFrac a, Floating a) => ToColor (Colour a)Defined in skylighting-core-0.15 · Skylighting.TypesToColor (ColorIntensity, Color)Defined in skylighting-format-ansi-0.1 · Skylighting.Format.ANSI · orphanToColor (Double, Double, Double)Defined in skylighting-core-0.15 · Skylighting.TypesToColor (Word8, Word8, Word8)Defined in skylighting-core-0.15 · Skylighting.Types
A pair consisting of a list of attributes and some text.
A TokenStyle determines how a token is to be rendered.
Constructors
TokenStyletokenColor :: !Maybe ColortokenBackground :: !Maybe ColortokenBold :: !BooltokenItalic :: !BooltokenUnderline :: !Bool
Instances10Eq, Data, Ord, Read, Show, Generic, …
Eq TokenStyleDefined in skylighting-core-0.15 · Skylighting.TypesData TokenStyleDefined in skylighting-core-0.15 · Skylighting.TypesOrd TokenStyleDefined in skylighting-core-0.15 · Skylighting.TypesRead TokenStyleDefined in skylighting-core-0.15 · Skylighting.TypesShow TokenStyleDefined in skylighting-core-0.15 · Skylighting.TypesGeneric TokenStyleDefined in skylighting-core-0.15 · Skylighting.TypesBinary TokenStyleDefined in skylighting-core-0.15 · Skylighting.TypesFromJSON TokenStyleDefined in skylighting-core-0.15 · Skylighting.TypesThe keywords used in KDE syntax themes are used, e.g.
text-colorfor default token color.ToJSON TokenStyleDefined in skylighting-core-0.15 · Skylighting.Typestype Rep TokenStyle = D1 ('MetaDataDefined in skylighting-core-0.15 · Skylighting.Types"TokenStyle"
"Skylighting.Types"
"skylighting-core-0.15-FF2LhjzpZ2i5WHVNZhqtEA"
'False) (C1 ('MetaCons"TokenStyle"
'PrefixI 'True) ((S1 ('MetaSel ('Just"tokenColor"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Color)) :*: S1 ('MetaSel ('Just"tokenBackground"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Color))) :*: (S1 ('MetaSel ('Just"tokenBold"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: (S1 ('MetaSel ('Just"tokenItalic"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just"tokenUnderline"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)))))
KeywordTok corresponds to dsKeyword in Kate syntax
descriptions, and so on.
Instances14Bounded, Enum, Eq, Data, Ord, Read, …
Bounded TokenTypeDefined in skylighting-core-0.15 · Skylighting.TypesEnum TokenTypeDefined in skylighting-core-0.15 · Skylighting.TypesEq TokenTypeDefined in skylighting-core-0.15 · Skylighting.TypesData TokenTypeDefined in skylighting-core-0.15 · Skylighting.TypesOrd TokenTypeDefined in skylighting-core-0.15 · Skylighting.TypesRead TokenTypeDefined in skylighting-core-0.15 · Skylighting.TypesShow TokenTypeDefined in skylighting-core-0.15 · Skylighting.TypesGeneric TokenTypeDefined in skylighting-core-0.15 · Skylighting.TypesBinary TokenTypeDefined in skylighting-core-0.15 · Skylighting.TypesFromJSON TokenTypeDefined in skylighting-core-0.15 · Skylighting.TypesFromJSONKey TokenTypeDefined in skylighting-core-0.15 · Skylighting.TypesJSON
corresponds to KeywordTok, and so on.KeywordToJSON TokenTypeDefined in skylighting-core-0.15 · Skylighting.TypesToJSONKey TokenTypeDefined in skylighting-core-0.15 · Skylighting.Typestype Rep TokenType = D1 ('MetaDataDefined in skylighting-core-0.15 · Skylighting.Types"TokenType"
"Skylighting.Types"
"skylighting-core-0.15-FF2LhjzpZ2i5WHVNZhqtEA"
'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)))))
A set of "words," possibly case insensitive.
Constructors
CaseSensitiveWords !(Set a)CaseInsensitiveWords !(Set a)
Instances8Eq, Data, Ord, Read, Show, Generic, …
Eq a => Eq (WordSet a)Defined in skylighting-core-0.15 · Skylighting.Types(Data a, Ord a) => Data (WordSet a)Defined in skylighting-core-0.15 · Skylighting.TypesOrd a => Ord (WordSet a)Defined in skylighting-core-0.15 · Skylighting.Types(Read a, Ord a) => Read (WordSet a)Defined in skylighting-core-0.15 · Skylighting.TypesShow a => Show (WordSet a)Defined in skylighting-core-0.15 · Skylighting.TypesGeneric (WordSet a)Defined in skylighting-core-0.15 · Skylighting.TypesBinary a => Binary (WordSet a)Defined in skylighting-core-0.15 · Skylighting.Typestype Rep (WordSet a) = D1 ('MetaDataDefined in skylighting-core-0.15 · Skylighting.Types"WordSet"
"Skylighting.Types"
"skylighting-core-0.15-FF2LhjzpZ2i5WHVNZhqtEA"
'False) (C1 ('MetaCons"CaseSensitiveWords"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set a))) :+: C1 ('MetaCons"CaseInsensitiveWords"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set a))))
Tokenize some text using Syntax. Note that the syntax definitions are assumed to have their keyword lists already resolved into word sets (as is the case for the bundled syntax definitions and for definitions loaded with the functions in Skylighting.Loader). If you construct a syntax map yourself from syntaxes parsed with parseSyntaxDefinition, apply resolveKeywords to each syntax first.
Configuration options for tokenize.
Constructors
TokenizerConfigsyntaxMap :: SyntaxMapSyntax map to use
traceOutput :: BoolGenerate trace output for debugging
Instances2Show, MonadReader
Show TokenizerConfigDefined in skylighting-core-0.15 · Skylighting.TokenizerMonadReader TokenizerConfig TokenizerMDefined in skylighting-core-0.15 · Skylighting.Tokenizer
Adds a syntax definition to a syntax map, replacing any existing definition with the same name.
Scan a list of Syntaxs and make sure that IncludeRules never asks for a syntax not in this list. Produces a list of pairs where the first element is the including syntax name and the second element is the (missing) included syntax name. This is intended for sanity checks to avoid run-time errors.
Parses a file containing a Kate XML syntax definition into a Syntax description. Note that the resulting Syntax must be processed with resolveKeywords (once the full syntax map is assembled) before it can be used for tokenizing; the functions in Skylighting.Loader do this automatically.
Resolve Keyword matchers that refer to lists; following up include directives in the syntax map and producing WordSets.
Compile a UTF-8 encoded ByteString as a Regex. If the first
parameter is True, then the Regex will be case sensitive. If the
second parameter is True, quantifiers are minimal (lazy) rather
than greedy by default, and the ? modifier makes them greedy
instead of lazy -- this corresponds to PCRE's UNGREEDY option
(QRegularExpression's InvertedGreedinessOption, set by
minimal="1" in KDE syntax definitions).
Match a Regex against a (presumed UTF-8 encoded) ByteString,
returning the matched text and a map of (offset, size)
pairs for captures. Note that all matches are from the
beginning of the string (a ^ anchor is implicit). As in
PCRE, the match returned is the first one that a backtracking
matcher would find (leftmost alternatives are preferred), which
is not necessarily the longest. Note also that to avoid
pathological performance in certain cases, the matcher is limited
to considering 2000 possible matches at a time; when that
threshold is reached, it discards lower-priority matches. Hence
certain regexes may incorrectly fail to match: e.g. a*a{3000}$
on a string of 3000 as.
Like matchRegex, but takes the map of capturing groups (as
computed by extractCapturingGroups) as an argument, so that it
can be computed once per regex instead of once per match. (The
map is only consulted for regexes containing subroutine calls
like (?1) or (?R).)
The compiled regex and its capturing groups (cached in the RE by the smart constructor).
Constructors
MatchAnyCharMatchDynamic !IntMatchChar (Char -> Bool)MatchSome !RegexMatchAlt !Regex !RegexMatchConcat !Regex !RegexMatchCapture !Int !RegexMatchCaptured !Int !BoolAssertWordBoundaryAssertBeginningAssertEndAssertPositive !Direction !RegexAssertNegative !Direction !RegexPossessive !RegexLazy !RegexSubroutine !IntMatchNull
A representation of a regular expression.
Instances8Eq, Data, Ord, Read, Show, Binary, …
Eq REDefined in skylighting-core-0.15 · Skylighting.RegexData REDefined in skylighting-core-0.15 · Skylighting.RegexOrd REDefined in skylighting-core-0.15 · Skylighting.RegexRead REDefined in skylighting-core-0.15 · Skylighting.RegexShow REDefined in skylighting-core-0.15 · Skylighting.RegexBinary REDefined in skylighting-core-0.15 · Skylighting.RegexFromJSON REDefined in skylighting-core-0.15 · Skylighting.RegexToJSON REDefined in skylighting-core-0.15 · Skylighting.Regex
Style from the breeze-dark KDE syntax highlighting theme.
Style based on ultraviolet's espresso_libre.css (dark background).
Style based on haddock's source highlighting.
Style based on kate's default colors.
Style with no colors.
Parse a KDE theme JSON document into a skylighting Style.
Style based on pygments's default colors.
Style based on pygments's tango colors.
Style based on the popular zenburn vim color scheme
Format tokens as a ConTeXt highlighting typing environment. The
highlighting environemnt is defined by the macros produced by
styleToConTeXt; it is a typing environment with default escaping
enabled, i.e., / is the escape character.
Formats tokens as ConTeXt using custom commands inside a type{}.
A KeywordTok is rendered using \KeywordTok{..}, and so on.
Converts a Style to a set of ConTeXt command definitions, which should be placed in the document's preamble.
Like formatHtmlBlock but uses only attributes valid in HTML 4
(so, no aria-hidden or aria-label attributes are used on the
line anchors).
Format tokens as an HTML pre block. Each line is wrapped in a
span element whose id is the line number (prefixed with lineIdPrefix),
beginning with an empty anchor linking to the line. If line numbering
is selected, the surrounding pre is given the class ‘numberSource’,
and the resulting html will display line numbers thanks to the included
CSS. See the documentation for formatHtmlInline for information about how
tokens are encoded.
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,
CommentTok = co,
OtherTok = ot,
AlertTok = al,
FunctionTok = fu,
RegionMarkerTok = re,
ErrorTok = er,
ConstantTok = cn,
SpecialCharTok = sc,
VerbatimStringTok = vs,
SpecialStringTok = ss,
ImportTok = im,
DocumentationTok = do,
AnnotationTok = an,
CommentVarTok = cv,
VariableTok = va,
ControlFlowTok = cf,
OperatorTok = op,
BuiltInTok = bu,
ExtensionTok = ex,
PreprocessorTok = pp,
AttributeTok = at,
InformationTok = in,
WarningTok = wa.
A NormalTok is not marked up at all.
Returns CSS for styling highlighted code according to the given style.
Format tokens as a LaTeX Highlighting environment inside a
Shaded environment. Highlighting and Shaded are
defined by the macros produced by styleToLaTeX. Highlighting
is a verbatim environment using fancyvrb; \, {, and }
have their normal meanings inside this environment, so that
formatting commands work. Shaded is either nothing
(if the style's background color is default) or a snugshade
environment from framed, providing a background color
for the whole code block, even if it spans multiple pages.
Formats tokens as LaTeX using custom commands inside
| characters. Assumes that | is defined as a short verbatim
command by the macros produced by styleToLaTeX.
A KeywordTok is rendered using \KeywordTok{..}, and so on.
Converts a Style to a set of LaTeX macro definitions, which should be placed in the document's preamble. Note: default LaTeX setup doesn't allow boldface typewriter font. To make boldface work in styles, you need to use a different typewriter font. This will work for computer modern:
\DeclareFontShape{OT1}{cmtt}{bx}{n}{<5><6><7><8><9><10><10.95><12><14.4><17.28><20.74><24.88>cmttb10}{}Or, with xelatex:
\usepackage{fontspec}
\setmainfont[SmallCapsFont={* Caps}]{Latin Modern Roman}
\setsansfont{Latin Modern Sans}
\setmonofont[SmallCapsFont={Latin Modern Mono Caps}]{Latin Modern Mono Light}Format tokens as a Typst Highlighting environment inside a
Skylighting block that can be styled. Skylighting is
defined by the macros produced by styleToTypst.
Formats tokens as Typst using custom commands inside
| characters. Assumes that | is defined as a short verbatim
command by the macros produced by styleToTypst.
A KeywordTok is rendered using \KeywordTok{..}, and so on.
Converts a Style to a set of Typst macro definitions, which should be placed in the document's preamble.
Loads a syntax definition from the specified file path. The file path must refer to a file containing an XML Kate syntax definition.
Loads all syntax definitions from the specified directory by looking for files with an ".xml" extension. This function assumes such files are Kate XML syntax definitions, so XML files with unexpected contents will cause a parsing error returned as a Left and syntax parsing will be aborted.
Loads all valid syntax definitions from the specified directory by looking for files with an ".xml" extension. Any files that are not valid Kate XML syntax definitions will have an entry in the resulting error map; the returned SyntaxMap will be made up of only the files that could successfully be loaded and parsed.