-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Syntax highlighting
--   
--   highlighting-kate is a syntax highlighting library with support for
--   nearly one hundred languages. The syntax parsers are automatically
--   generated from Kate syntax descriptions
--   (<a>http://kate-editor.org/</a>), so any syntax supported by Kate can
--   be added. An (optional) command-line program is provided, along with a
--   utility for generating new parsers from Kate XML syntax descriptions.
@package highlighting-kate
@version 0.6


-- | Definitions for data structures needed by highlighting-kate.
module Text.Highlighting.Kate.Types

-- | A context: pair of syntax name and context name.
type Context = (String, String)

-- | A stack of contexts. (Language-specific context stacks must be
--   maintained because of IncludeRules.)
type ContextStack = [Context]

-- | State for syntax parser.
data SyntaxState
SyntaxState :: ContextStack -> Int -> Char -> Bool -> Bool -> Bool -> Bool -> [String] -> SyntaxState

-- | Stack of contexts
[synStContexts] :: SyntaxState -> ContextStack

-- | Number of current line
[synStLineNumber] :: SyntaxState -> Int

-- | Last character parsed
[synStPrevChar] :: SyntaxState -> Char

-- | True if we've parsed a nonspace
[synStPrevNonspace] :: SyntaxState -> Bool

-- | True if last thing parsed is a LineContinue
[synStContinuation] :: SyntaxState -> Bool

-- | Language is case-sensitive
[synStCaseSensitive] :: SyntaxState -> Bool

-- | Keywords are case-sensitive
[synStKeywordCaseSensitive] :: SyntaxState -> Bool

-- | List of regex captures from last capturing match
[synStCaptures] :: SyntaxState -> [String]
defaultSyntaxState :: SyntaxState

-- | A pair consisting of a list of attributes and some text.
type Token = (TokenType, String)
data TokenType
KeywordTok :: TokenType
DataTypeTok :: TokenType
DecValTok :: TokenType
BaseNTok :: TokenType
FloatTok :: TokenType
ConstantTok :: TokenType
CharTok :: TokenType
SpecialCharTok :: TokenType
StringTok :: TokenType
VerbatimStringTok :: TokenType
SpecialStringTok :: TokenType
ImportTok :: TokenType
CommentTok :: TokenType
DocumentationTok :: TokenType
AnnotationTok :: TokenType
CommentVarTok :: TokenType
OtherTok :: TokenType
FunctionTok :: TokenType
VariableTok :: TokenType
ControlFlowTok :: TokenType
OperatorTok :: TokenType
BuiltInTok :: TokenType
ExtensionTok :: TokenType
PreprocessorTok :: TokenType
AttributeTok :: TokenType
RegionMarkerTok :: TokenType
InformationTok :: TokenType
WarningTok :: TokenType
AlertTok :: TokenType
ErrorTok :: TokenType
NormalTok :: TokenType

-- | A line of source, list of labeled source items.
type SourceLine = [Token]
type KateParser = GenParser Char SyntaxState
data TokenStyle
TokenStyle :: Maybe Color -> Maybe Color -> Bool -> Bool -> Bool -> TokenStyle
[tokenColor] :: TokenStyle -> Maybe Color
[tokenBackground] :: TokenStyle -> Maybe Color
[tokenBold] :: TokenStyle -> Bool
[tokenItalic] :: TokenStyle -> Bool
[tokenUnderline] :: TokenStyle -> Bool
defStyle :: TokenStyle
data Color
RGB :: Word8 -> Word8 -> Word8 -> Color
class ToColor a
toColor :: ToColor a => a -> Maybe Color
class FromColor a
fromColor :: FromColor a => Color -> a
data Style
Style :: [(TokenType, TokenStyle)] -> Maybe Color -> Maybe Color -> Maybe Color -> Maybe Color -> Style
[tokenStyles] :: Style -> [(TokenType, TokenStyle)]
[defaultColor] :: Style -> Maybe Color
[backgroundColor] :: Style -> Maybe Color
[lineNumberColor] :: Style -> Maybe Color
[lineNumberBackgroundColor] :: Style -> Maybe Color

-- | Options for formatting source code.
data FormatOptions
FormatOptions :: Bool -> Int -> Bool -> Bool -> [String] -> [String] -> FormatOptions

-- | Number lines
[numberLines] :: FormatOptions -> Bool

-- | Number of first line
[startNumber] :: FormatOptions -> Int

-- | Anchors on each line number
[lineAnchors] :: FormatOptions -> Bool

-- | Html titles with token types
[titleAttributes] :: FormatOptions -> Bool

-- | Additional classes for Html code tag
[codeClasses] :: FormatOptions -> [String]

-- | Additional classes for Html container tag (pre or table depending on
--   numberLines)
[containerClasses] :: FormatOptions -> [String]
defaultFormatOpts :: FormatOptions
instance GHC.Read.Read Text.Highlighting.Kate.Types.FormatOptions
instance GHC.Show.Show Text.Highlighting.Kate.Types.FormatOptions
instance GHC.Classes.Eq Text.Highlighting.Kate.Types.FormatOptions
instance Data.Data.Data Text.Highlighting.Kate.Types.Style
instance GHC.Show.Show Text.Highlighting.Kate.Types.Style
instance GHC.Read.Read Text.Highlighting.Kate.Types.Style
instance Data.Data.Data Text.Highlighting.Kate.Types.TokenStyle
instance GHC.Read.Read Text.Highlighting.Kate.Types.TokenStyle
instance GHC.Show.Show Text.Highlighting.Kate.Types.TokenStyle
instance Data.Data.Data Text.Highlighting.Kate.Types.Color
instance GHC.Read.Read Text.Highlighting.Kate.Types.Color
instance GHC.Show.Show Text.Highlighting.Kate.Types.Color
instance Data.Data.Data Text.Highlighting.Kate.Types.TokenType
instance GHC.Enum.Enum Text.Highlighting.Kate.Types.TokenType
instance GHC.Classes.Eq Text.Highlighting.Kate.Types.TokenType
instance GHC.Show.Show Text.Highlighting.Kate.Types.TokenType
instance GHC.Read.Read Text.Highlighting.Kate.Types.TokenType
instance GHC.Show.Show Text.Highlighting.Kate.Types.SyntaxState
instance Text.Highlighting.Kate.Types.ToColor GHC.Base.String
instance Text.Highlighting.Kate.Types.ToColor GHC.Types.Int
instance Text.Highlighting.Kate.Types.ToColor (GHC.Word.Word8, GHC.Word.Word8, GHC.Word.Word8)
instance Text.Highlighting.Kate.Types.ToColor (GHC.Types.Double, GHC.Types.Double, GHC.Types.Double)
instance Text.Highlighting.Kate.Types.FromColor GHC.Base.String
instance Text.Highlighting.Kate.Types.FromColor (GHC.Types.Double, GHC.Types.Double, GHC.Types.Double)
instance Text.Highlighting.Kate.Types.FromColor (GHC.Word.Word8, GHC.Word.Word8, GHC.Word.Word8)


-- | Styles for rendering annotated source lines.
module Text.Highlighting.Kate.Styles

-- | Style based on pygments's default colors.
pygments :: Style

-- | Style based on kate's default colors.
kate :: Style

-- | Style based on ultraviolet's espresso_libre.css (dark background).
espresso :: Style

-- | Style based on pygments's tango colors.
tango :: Style

-- | Style based on haddock's source highlighting.
haddock :: Style

-- | Style with no colors.
monochrome :: Style

-- | Style based on the popular zenburn vim color scheme
zenburn :: Style


-- | Formatters that convert a list of annotated source lines to HTML.
module Text.Highlighting.Kate.Format.HTML

-- | Format tokens using HTML spans inside <tt>code</tt> tags. For example,
--   A <tt>KeywordTok</tt> is rendered as a span with class <tt>kw</tt>.
--   Short class names correspond to <a>TokenType</a>s as follows:
--   <a>KeywordTok</a> = <tt>kw</tt>, <a>DataTypeTok</a> = <tt>dt</tt>,
--   <a>DecValTok</a> = <tt>dv</tt>, <a>BaseNTok</a> = <tt>bn</tt>,
--   <a>FloatTok</a> = <tt>fl</tt>, <a>CharTok</a> = <tt>ch</tt>,
--   <a>StringTok</a> = <tt>st</tt>, <tt>CommontTok</tt> = <tt>co</tt>,
--   <a>OtherTok</a> = <tt>ot</tt>, <a>AlertTok</a> = <tt>al</tt>,
--   <a>FunctionTok</a> = <tt>fu</tt>, <a>RegionMarkerTok</a> =
--   <tt>re</tt>, <a>ErrorTok</a> = <tt>er</tt>, <a>ConstantTok</a> =
--   <tt>cn</tt>, <a>SpecialCharTok</a> = <tt>sc</tt>,
--   <a>VerbatimStringTok</a> = <tt>vs</tt>, <a>SpecialStringTok</a> =
--   <tt>ss</tt>, <a>ImportTok</a> = <tt>im</tt>, <a>DocumentationTok</a> =
--   <tt>do</tt>, <a>AnnotationTok</a> = <tt>an</tt>, <a>CommentVarTok</a>
--   = <tt>cv</tt>, <a>VariableTok</a> = <tt>va</tt>, <a>ControlFlowTok</a>
--   = <tt>cf</tt>, <a>OperatorTok</a> = <tt>op</tt>, <a>BuiltInTok</a> =
--   <tt>bu</tt>, <a>ExtensionTok</a> = <tt>ex</tt>, <a>PreprocessorTok</a>
--   = <tt>pp</tt>, <a>AttributeTok</a> = <tt>at</tt>,
--   <a>InformationTok</a> = <tt>in</tt>, <a>WarningTok</a> = <tt>wa</tt>.
--   A <a>NormalTok</a> is not marked up at all.
formatHtmlInline :: FormatOptions -> [SourceLine] -> Html

-- | Format tokens as an HTML <tt>pre</tt> 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 <tt>div</tt> element to aid
--   styling (e.g. the overflow-x property).
formatHtmlBlock :: FormatOptions -> [SourceLine] -> Html

-- | Returns CSS for styling highlighted code according to the given style.
styleToCss :: Style -> String


-- | Formatters that convert a list of annotated source lines to LaTeX.
module Text.Highlighting.Kate.Format.LaTeX

-- | Formats tokens as LaTeX using custom commands inside <tt>|</tt>
--   characters. Assumes that <tt>|</tt> is defined as a short verbatim
--   command by the macros produced by <a>styleToLaTeX</a>. A
--   <tt>KeywordTok</tt> is rendered using <tt>\KeywordTok{..}</tt>, and so
--   on.
formatLaTeXInline :: FormatOptions -> [SourceLine] -> String

-- | Format tokens as a LaTeX <tt>Highlighting</tt> environment inside a
--   <tt>Shaded</tt> environment. <tt>Highlighting</tt> and <tt>Shaded</tt>
--   are defined by the macros produced by <a>styleToLaTeX</a>.
--   <tt>Highlighting</tt> is a verbatim environment using
--   <tt>fancyvrb</tt>; <tt>\</tt>, <tt>{</tt>, and <tt>}</tt> have their
--   normal meanings inside this environment, so that formatting commands
--   work. <tt>Shaded</tt> is either nothing (if the style's background
--   color is default) or a <tt>snugshade</tt> environment from
--   <tt>framed</tt>, providing a background color for the whole code
--   block, even if it spans multiple pages.
formatLaTeXBlock :: FormatOptions -> [SourceLine] -> String

-- | Converts a <a>Style</a> 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:
--   
--   <pre>
--   \DeclareFontShape{OT1}{cmtt}{bx}{n}{&lt;5&gt;&lt;6&gt;&lt;7&gt;&lt;8&gt;&lt;9&gt;&lt;10&gt;&lt;10.95&gt;&lt;12&gt;&lt;14.4&gt;&lt;17.28&gt;&lt;20.74&gt;&lt;24.88&gt;cmttb10}{}
--   </pre>
--   
--   Or, with xelatex:
--   
--   <pre>
--   \usepackage{fontspec}
--   \setmainfont[SmallCapsFont={* Caps}]{Latin Modern Roman}
--   \setsansfont{Latin Modern Sans}
--   \setmonofont[SmallCapsFont={Latin Modern Mono Caps}]{Latin Modern Mono Light}
--   </pre>
styleToLaTeX :: Style -> String


-- | Token lexer for various languages.
module Text.Highlighting.Kate.Syntax

-- | Highlight source code. The source language may be specified by its
--   canonical name (case-insensitive) or by a canonical extension (if
--   unique). The parsers read the input lazily and parse line by line;
--   results are returned immediately. Supported languages: <tt>abc</tt>,
--   <tt>actionscript</tt>, <tt>ada</tt>, <tt>agda</tt>, <tt>alert</tt>,
--   <tt>alert_indent</tt>, <tt>apache</tt>, <tt>asn1</tt>, <tt>asp</tt>,
--   <tt>awk</tt>, <tt>bash</tt>, <tt>bibtex</tt>, <tt>boo</tt>,
--   <tt>c</tt>, <tt>changelog</tt>, <tt>clojure</tt>, <tt>cmake</tt>,
--   <tt>coffee</tt>, <tt>coldfusion</tt>, <tt>commonlisp</tt>,
--   <tt>cpp</tt>, <tt>cs</tt>, <tt>css</tt>, <tt>curry</tt>, <tt>d</tt>,
--   <tt>diff</tt>, <tt>djangotemplate</tt>, <tt>dockerfile</tt>,
--   <tt>dot</tt>, <tt>doxygen</tt>, <tt>doxygenlua</tt>, <tt>dtd</tt>,
--   <tt>eiffel</tt>, <tt>email</tt>, <tt>erlang</tt>, <tt>fasm</tt>,
--   <tt>fortran</tt>, <tt>fsharp</tt>, <tt>gcc</tt>, <tt>glsl</tt>,
--   <tt>gnuassembler</tt>, <tt>go</tt>, <tt>haskell</tt>, <tt>haxe</tt>,
--   <tt>html</tt>, <tt>idris</tt>, <tt>ini</tt>, <tt>isocpp</tt>,
--   <tt>java</tt>, <tt>javadoc</tt>, <tt>javascript</tt>, <tt>json</tt>,
--   <tt>jsp</tt>, <tt>julia</tt>, <tt>kotlin</tt>, <tt>latex</tt>,
--   <tt>lex</tt>, <tt>lilypond</tt>, <tt>literatecurry</tt>,
--   <tt>literatehaskell</tt>, <tt>lua</tt>, <tt>m4</tt>,
--   <tt>makefile</tt>, <tt>mandoc</tt>, <tt>markdown</tt>,
--   <tt>mathematica</tt>, <tt>matlab</tt>, <tt>maxima</tt>,
--   <tt>mediawiki</tt>, <tt>metafont</tt>, <tt>mips</tt>,
--   <tt>modelines</tt>, <tt>modula2</tt>, <tt>modula3</tt>,
--   <tt>monobasic</tt>, <tt>nasm</tt>, <tt>noweb</tt>,
--   <tt>objectivec</tt>, <tt>objectivecpp</tt>, <tt>ocaml</tt>,
--   <tt>octave</tt>, <tt>opencl</tt>, <tt>pascal</tt>, <tt>perl</tt>,
--   <tt>php</tt>, <tt>pike</tt>, <tt>postscript</tt>, <tt>prolog</tt>,
--   <tt>pure</tt>, <tt>python</tt>, <tt>r</tt>, <tt>relaxng</tt>,
--   <tt>relaxngcompact</tt>, <tt>rest</tt>, <tt>rhtml</tt>, <tt>roff</tt>,
--   <tt>ruby</tt>, <tt>rust</tt>, <tt>scala</tt>, <tt>scheme</tt>,
--   <tt>sci</tt>, <tt>sed</tt>, <tt>sgml</tt>, <tt>sql</tt>,
--   <tt>sqlmysql</tt>, <tt>sqlpostgresql</tt>, <tt>tcl</tt>,
--   <tt>tcsh</tt>, <tt>texinfo</tt>, <tt>verilog</tt>, <tt>vhdl</tt>,
--   <tt>xml</tt>, <tt>xorg</tt>, <tt>xslt</tt>, <tt>xul</tt>,
--   <tt>yacc</tt>, <tt>yaml</tt>, <tt>zsh</tt>.
highlightAs :: String -> String -> [SourceLine]

-- | List of supported languages.
languages :: [String]

-- | Returns a list of languages appropriate for the given file extension.
languagesByExtension :: String -> [String]

-- | Returns a list of languages appropriate for the given filename.
languagesByFilename :: FilePath -> [String]


-- | This helper module exports the main highlighting and formatting
--   functions.
--   
--   A typical application will combine a highlighter and a formatter. This
--   one reads ruby code from stdin and writes HTML:
--   
--   <pre>
--   import Text.Highlighting.Kate
--   import Text.Blaze.Html.Renderer.String (renderHtml)
--   import Text.Blaze.Html (toHtml)
--   import Text.Blaze.Html5 as H
--   import Text.Blaze.Html5.Attributes as A
--   
--   main = do
--     code &lt;- getContents
--     putStrLn $ renderHtml
--              $ do H.head $ H.style ! A.type_ (toValue "text/css")
--                          $ toHtml $ styleToCss tango
--                   H.body $ toHtml
--                          $ formatHtmlBlock defaultFormatOpts
--                          $ highlightAs "ruby" code
--   </pre>
module Text.Highlighting.Kate

-- | Highlight source code. The source language may be specified by its
--   canonical name (case-insensitive) or by a canonical extension (if
--   unique). The parsers read the input lazily and parse line by line;
--   results are returned immediately. Supported languages: <tt>abc</tt>,
--   <tt>actionscript</tt>, <tt>ada</tt>, <tt>agda</tt>, <tt>alert</tt>,
--   <tt>alert_indent</tt>, <tt>apache</tt>, <tt>asn1</tt>, <tt>asp</tt>,
--   <tt>awk</tt>, <tt>bash</tt>, <tt>bibtex</tt>, <tt>boo</tt>,
--   <tt>c</tt>, <tt>changelog</tt>, <tt>clojure</tt>, <tt>cmake</tt>,
--   <tt>coffee</tt>, <tt>coldfusion</tt>, <tt>commonlisp</tt>,
--   <tt>cpp</tt>, <tt>cs</tt>, <tt>css</tt>, <tt>curry</tt>, <tt>d</tt>,
--   <tt>diff</tt>, <tt>djangotemplate</tt>, <tt>dockerfile</tt>,
--   <tt>dot</tt>, <tt>doxygen</tt>, <tt>doxygenlua</tt>, <tt>dtd</tt>,
--   <tt>eiffel</tt>, <tt>email</tt>, <tt>erlang</tt>, <tt>fasm</tt>,
--   <tt>fortran</tt>, <tt>fsharp</tt>, <tt>gcc</tt>, <tt>glsl</tt>,
--   <tt>gnuassembler</tt>, <tt>go</tt>, <tt>haskell</tt>, <tt>haxe</tt>,
--   <tt>html</tt>, <tt>idris</tt>, <tt>ini</tt>, <tt>isocpp</tt>,
--   <tt>java</tt>, <tt>javadoc</tt>, <tt>javascript</tt>, <tt>json</tt>,
--   <tt>jsp</tt>, <tt>julia</tt>, <tt>kotlin</tt>, <tt>latex</tt>,
--   <tt>lex</tt>, <tt>lilypond</tt>, <tt>literatecurry</tt>,
--   <tt>literatehaskell</tt>, <tt>lua</tt>, <tt>m4</tt>,
--   <tt>makefile</tt>, <tt>mandoc</tt>, <tt>markdown</tt>,
--   <tt>mathematica</tt>, <tt>matlab</tt>, <tt>maxima</tt>,
--   <tt>mediawiki</tt>, <tt>metafont</tt>, <tt>mips</tt>,
--   <tt>modelines</tt>, <tt>modula2</tt>, <tt>modula3</tt>,
--   <tt>monobasic</tt>, <tt>nasm</tt>, <tt>noweb</tt>,
--   <tt>objectivec</tt>, <tt>objectivecpp</tt>, <tt>ocaml</tt>,
--   <tt>octave</tt>, <tt>opencl</tt>, <tt>pascal</tt>, <tt>perl</tt>,
--   <tt>php</tt>, <tt>pike</tt>, <tt>postscript</tt>, <tt>prolog</tt>,
--   <tt>pure</tt>, <tt>python</tt>, <tt>r</tt>, <tt>relaxng</tt>,
--   <tt>relaxngcompact</tt>, <tt>rest</tt>, <tt>rhtml</tt>, <tt>roff</tt>,
--   <tt>ruby</tt>, <tt>rust</tt>, <tt>scala</tt>, <tt>scheme</tt>,
--   <tt>sci</tt>, <tt>sed</tt>, <tt>sgml</tt>, <tt>sql</tt>,
--   <tt>sqlmysql</tt>, <tt>sqlpostgresql</tt>, <tt>tcl</tt>,
--   <tt>tcsh</tt>, <tt>texinfo</tt>, <tt>verilog</tt>, <tt>vhdl</tt>,
--   <tt>xml</tt>, <tt>xorg</tt>, <tt>xslt</tt>, <tt>xul</tt>,
--   <tt>yacc</tt>, <tt>yaml</tt>, <tt>zsh</tt>.
highlightAs :: String -> String -> [SourceLine]

-- | List of supported languages.
languages :: [String]

-- | Returns a list of languages appropriate for the given file extension.
languagesByExtension :: String -> [String]

-- | Returns a list of languages appropriate for the given filename.
languagesByFilename :: FilePath -> [String]
highlightingKateVersion :: String
