cmark-highlight-0.2.0.0: Code highlighting for cmark

Safe HaskellNone
LanguageHaskell2010

CMark.Highlight

Contents

Synopsis

Highlighting

highlightNode :: Node -> Node 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.

highlightNodeWith :: (Text -> Text -> FormatOptions -> FormatOptions) -> Node -> Node 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 [].

Options

data FormatOptions :: * #

Options for formatting source code.

Constructors

FormatOptions 

Fields

Styles

styleToCss :: Style -> String #

Returns CSS for styling highlighted code according to the given style.