commonmark-0.2.1: Pure Haskell commonmark parser.
Safe HaskellNone
LanguageHaskell2010

Commonmark.Parser

Synopsis

Documentation

commonmark Source #

Arguments

:: IsBlock il bl 
=> String

Name or path of input

-> Text

Commonmark text input

-> Either ParseError bl

Result or error

Parse a commonmark document using the core syntax elements. To produce HTML, instantiate bl with Html () (see Html. If you want to add syntax extensions or run the parser in a monadic context, use commonmarkWith. If you want to operate on tokenized input, use parseCommonmarkWith.

commonmarkWith Source #

Arguments

:: (Monad m, IsBlock il bl, IsInline il) 
=> SyntaxSpec m il bl

Defines syntax

-> String

Name or path of input

-> Text

Commonmark text input

-> m (Either ParseError bl)

Result or error

Like commonmark, but allows specifying a custom syntax and a monadic context (since some syntax extensions may only be defined in certain monads, e.g. an extension for include files may require IO).

parseCommonmarkWith Source #

Arguments

:: (Monad m, IsBlock il bl, IsInline il) 
=> SyntaxSpec m il bl

Defines syntax

-> [Tok]

Tokenized commonmark input

-> m (Either ParseError bl)

Result or error

Parse a tokenized commonmark document using specified syntax elements. Use tokenize to convert Text into [Tok].

Exported from Text.Parsec.Error

data ParseError #

Instances

Instances details
Eq ParseError 
Instance details

Defined in Text.Parsec.Error

Methods

(==) :: ParseError -> ParseError -> Bool

(/=) :: ParseError -> ParseError -> Bool

Show ParseError 
Instance details

Defined in Text.Parsec.Error

Methods

showsPrec :: Int -> ParseError -> ShowS

show :: ParseError -> String

showList :: [ParseError] -> ShowS