-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Commonmark processing in pure haskell.
--
-- See README
@package comark
@version 0.1.0
-- | It mostly contains reexports from the following modules:
--
--
module Comark
-- | Parses Commonmark document. Any sequence of characters is a valid
-- Commonmark document.
--
-- At the moment no sanitizations are performed besides the ones defined
-- in the spec.
parse :: [ParserOption] -> Text -> Doc Text
data ParserOption :: *
-- | Consolidate adjacent text nodes.
Normalize :: ParserOption
-- | Predefine link reference defenitions.
--
-- References are represented with a mapping from a link text to a
-- pair of a link destination and an optional link title.
--
-- During parsing the link references defined in a document would be
-- collected into additional mapping. When link references are being
-- mapping defined in options takes precedence over mapping found in the
-- document.
--
-- TODO: Examples
LinkReferences :: (Text -> Maybe (Text, Maybe Text)) -> ParserOption
-- | Render a Commonmark document as HTML.
render :: Doc Text -> Text
-- | A Document
newtype Doc t :: * -> *
Doc :: Blocks t -> Doc t
type Blocks t = Seq (Block t)
-- | Block elements
data Block t :: * -> *
-- | Thematic break
ThematicBreak :: Block t
-- | Heading: level, sequnce of inlines that define content
Heading :: HeadingLevel -> Inlines t -> Block t
-- | Block of code: info string, literal content
CodeBlock :: Maybe t -> t -> Block t
-- | Raw HTML Block
HtmlBlock :: t -> Block t
-- | Paragraph (a grouped sequence of inlines)
Para :: Inlines t -> Block t
-- | Block Quote (a quoted sequence of blocks)
Quote :: Blocks t -> Block t
-- | List: Type of the list, tightness, a sequnce of blocks (list item)
List :: ListType -> Bool -> Seq (Blocks t) -> Block t
data HeadingLevel :: *
Heading1 :: HeadingLevel
Heading2 :: HeadingLevel
Heading3 :: HeadingLevel
Heading4 :: HeadingLevel
Heading5 :: HeadingLevel
Heading6 :: HeadingLevel
data ListType :: *
Ordered :: Delimiter -> Int -> ListType
Bullet :: BulletMarker -> ListType
data Delimiter :: *
Period :: Delimiter
Paren :: Delimiter
data BulletMarker :: *
-- |
-- -
--
Minus :: BulletMarker
-- |
-- +
--
Plus :: BulletMarker
-- |
-- *
--
Asterisk :: BulletMarker
type Inlines t = Seq (Inline t)
-- | Inline elements
data Inline t :: * -> *
-- | Text (string)
Str :: t -> Inline t
-- | Inline code
Code :: t -> Inline t
-- | Emphasized text (a sequence of inlines)
Emph :: Inlines t -> Inline t
-- | Strongly emphasized text (a sequence of inlines)
Strong :: Inlines t -> Inline t
-- | Hyperlink: visible link text (sequence of inlines), destination, title
Link :: Inlines t -> t -> Maybe t -> Inline t
-- | Image hyperlink: image description, destination, title
Image :: Inlines t -> t -> Maybe t -> Inline t
-- | Inline Raw HTML tag
RawHtml :: t -> Inline t
-- | A regular linebreak. A conforming renderer may render a soft line
-- break in HTML either as line break or as a space.
SoftBreak :: Inline t
-- | A line break that is marked as hard (either with spaces or backslash,
-- see the spec for details). In html it would be rendered as
-- /
HardBreak :: Inline t