Safe Haskell | None |
---|---|
Language | Haskell2010 |
- highlightDoc :: Doc -> Doc
- highlightDocWith :: (Text -> Text -> FormatOptions -> FormatOptions) -> Doc -> Doc
- highlightBlock :: Block -> Block
- highlightBlockWith :: (Text -> Text -> FormatOptions -> FormatOptions) -> Block -> Block
- data FormatOptions :: * = FormatOptions {
- numberLines :: Bool
- startNumber :: Int
- lineAnchors :: Bool
- titleAttributes :: Bool
- codeClasses :: [String]
- containerClasses :: [String]
- defaultFormatOpts :: FormatOptions
- module Text.Highlighting.Kate.Styles
- styleToCss :: Style -> String
Highlighting
highlightDoc :: Doc -> Doc Source
Highlight a document by replacing code blocks with raw HTML blocks.
By default, the rest of the attribute line (i.e. all words after the first word after ~~~
or ```
) get added as classes to the container block of the code.
highlightDocWith :: (Text -> Text -> FormatOptions -> FormatOptions) -> Doc -> Doc Source
The function is given code block's language (i.e. the 1st word of the attribute line after ~~~
or ```
) and the rest of the attribute line.
If you don't want the classes to be derived from the attribute line, make the function set containerClasses
to []
.
highlightBlock :: Block -> Block Source
highlightBlockWith :: (Text -> Text -> FormatOptions -> FormatOptions) -> Block -> Block Source
Options
data FormatOptions :: *
Options for formatting source code.
FormatOptions | |
|
Styles
styleToCss :: Style -> String
Returns CSS for styling highlighted code according to the given style.