    {-|
    Module      : Text.Jira.Parser
    Copyright   : © 2019–2023 Albert Krewinkel
    License     : MIT

    Maintainer  : Albert Krewinkel <tarleb@zeitkraut.de>
    Stability   : alpha
    Portability : portable

    Parse Jira wiki markup.
    -}
    module Text.Jira.Parser
      ( parse
      , doc
      , module Text.Jira.Markup
      , module Text.Jira.Parser.Core
      , module Text.Jira.Parser.Inline
      , module Text.Jira.Parser.Block
      , module Text.Jira.Parser.PlainText
      ) where

    import Data.Text (Text)
    import Text.Jira.Markup
    import Text.Jira.Parser.Block
    import Text.Jira.Parser.Core
    import Text.Jira.Parser.Inline
    import Text.Jira.Parser.PlainText
    import Text.Parsec hiding (parse)

    -- | Parses a document into a Jira AST.
    parse :: Text -> Either ParseError Doc
    parse :: Text -> Either ParseError Doc
    parse = JiraParser Doc -> Text -> Either ParseError Doc
    forall a. JiraParser a -> Text -> Either ParseError a
    parseJira JiraParser Doc
    doc

    -- | Parses a list of jira blocks into a @'Doc'@ element.
    doc :: JiraParser Doc
    doc :: JiraParser Doc
    doc = [Block] -> Doc
    Doc ([Block] -> Doc)
    -> ParsecT Text ParserState Identity [Block] -> JiraParser Doc
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (ParsecT Text ParserState Identity ()
    -> ParsecT Text ParserState Identity ()
    forall s u (m :: * -> *) a. ParsecT s u m a -> ParsecT s u m ()
    skipMany ParsecT Text ParserState Identity ()
    blankline ParsecT Text ParserState Identity ()
    -> ParsecT Text ParserState Identity [Block]
    -> ParsecT Text ParserState Identity [Block]
    forall a b.
    ParsecT Text ParserState Identity a
    -> ParsecT Text ParserState Identity b
    -> ParsecT Text ParserState Identity b
    forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
    *> ParsecT Text ParserState Identity Block
    -> ParsecT Text ParserState Identity [Block]
    forall s u (m :: * -> *) a. ParsecT s u m a -> ParsecT s u m [a]
    many ParsecT Text ParserState Identity Block
    block) JiraParser Doc -> String -> JiraParser Doc
    forall s u (m :: * -> *) a.
    ParsecT s u m a -> String -> ParsecT s u m a
    <?> String
    "doc"