Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- commonmark :: IsBlock il bl => String -> Text -> Either ParseError bl
- commonmarkWith :: (Monad m, IsBlock il bl, IsInline il) => SyntaxSpec m il bl -> String -> Text -> m (Either ParseError bl)
- parseCommonmarkWith :: (Monad m, IsBlock il bl, IsInline il) => SyntaxSpec m il bl -> [Tok] -> m (Either ParseError bl)
- data ParseError
Documentation
:: 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
(see
Html
()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
.
:: (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).
:: (Monad m, IsBlock il bl, IsInline il) | |
=> SyntaxSpec m il bl | Defines syntax |
-> [Tok] | Tokenized commonmark input |
-> m (Either ParseError bl) | Result or error |
Exported from Text.Parsec.Error
data ParseError #
The abstract data type ParseError
represents parse errors. It
provides the source position (SourcePos
) of the error
and a list of error messages (Message
). A ParseError
can be returned by the function parse
. ParseError
is an
instance of the Show
and Eq
classes.
Instances
Show ParseError | |
Defined in Text.Parsec.Error showsPrec :: Int -> ParseError -> ShowS # show :: ParseError -> String # showList :: [ParseError] -> ShowS # | |
Eq ParseError | |
Defined in Text.Parsec.Error (==) :: ParseError -> ParseError -> Bool # (/=) :: ParseError -> ParseError -> Bool # |