| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Commonmark.Parser
Contents
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
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 (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.
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).
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 |
Exported from Text.Parsec.Error
data ParseError #
Instances
| Exception ParseError # | |
Defined in Text.Parsec.Error Methods toException :: ParseError -> SomeException fromException :: SomeException -> Maybe ParseError displayException :: ParseError -> String backtraceDesired :: ParseError -> Bool | |
| Show ParseError # | |
Defined in Text.Parsec.Error Methods showsPrec :: Int -> ParseError -> ShowS show :: ParseError -> String showList :: [ParseError] -> ShowS | |
| Eq ParseError # | |
Defined in Text.Parsec.Error | |