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

Commonmark.Blocks

Contents

Synopsis

Documentation

mkBlockParser #

Arguments

:: (Monad m, IsBlock il bl) 
=> [BlockSpec m il bl]

Defines block syntax

-> [BlockParser m il bl bl]

Parsers to run at end

-> (ReferenceMap -> [Tok] -> m (Either ParseError il))

Inline parser

-> [BlockParser m il bl Attributes]

attribute parsers

-> [Tok]

Tokenized commonmark input

-> m (Either ParseError bl)

Result or error

defaultBlockSpecs :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => [BlockSpec m il bl] #

data BlockSpec (m :: Type -> Type) il bl #

Defines a block-level element type.

Constructors

BlockSpec 

Fields

Instances

Instances details
Show (BlockSpec m il bl) # 
Instance details

Defined in Commonmark.Blocks

Methods

showsPrec :: Int -> BlockSpec m il bl -> ShowS #

show :: BlockSpec m il bl -> String #

showList :: [BlockSpec m il bl] -> ShowS #

data BlockData (m :: Type -> Type) il bl #

Instances

Instances details
Show (BlockData m il bl) # 
Instance details

Defined in Commonmark.Blocks

Methods

showsPrec :: Int -> BlockData m il bl -> ShowS #

show :: BlockData m il bl -> String #

showList :: [BlockData m il bl] -> ShowS #

defBlockData :: forall (m :: Type -> Type) il bl. BlockSpec m il bl -> BlockData m il bl #

type BlockNode (m :: Type -> Type) il bl = Tree (BlockData m il bl) #

type BlockParser (m :: Type -> Type) il bl = ParsecT [Tok] (BPState m il bl) m #

data LinkInfo #

Constructors

LinkInfo 

Fields

Instances

Instances details
Show LinkInfo # 
Instance details

Defined in Commonmark.ReferenceMap

defaultFinalizer :: forall (m :: Type -> Type) il bl. Monad m => BlockNode m il bl -> BlockNode m il bl -> BlockParser m il bl (BlockNode m il bl) #

runInlineParser :: forall (m :: Type -> Type) il bl. Monad m => [Tok] -> BlockParser m il bl il #

addNodeToStack :: forall (m :: Type -> Type) bl il. Monad m => BlockNode m bl il -> BlockParser m bl il () #

collapseNodeStack :: forall (m :: Type -> Type) il bl. [BlockNode m il bl] -> BlockParser m il bl (BlockNode m il bl) #

getBlockText :: forall (m :: Type -> Type) il bl. BlockNode m il bl -> [Tok] #

removeIndent :: [Tok] -> [Tok] #

bspec :: forall (m :: Type -> Type) il bl. BlockNode m il bl -> BlockSpec m il bl #

endOfBlock :: forall (m :: Type -> Type) il bl. Monad m => BlockParser m il bl () #

interruptsParagraph :: forall (m :: Type -> Type) bl il. Monad m => BlockParser m bl il Bool #

linkReferenceDef :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m Attributes -> ParsecT [Tok] s m ((SourceRange, Text), LinkInfo) #

renderChildren :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockNode m il bl -> BlockParser m il bl [bl] #

getParentListType :: forall (m :: Type -> Type) il bl. Monad m => BlockParser m il bl (Maybe ListType) #

Get type of the enclosing List block. If the parent isn't a List block, return Nothing.

BlockSpecs

docSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl, Monoid bl) => BlockSpec m il bl #

indentedCodeSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl #

fencedCodeSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl #

blockQuoteSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl #

atxHeadingSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl #

setextHeadingSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl #

thematicBreakSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl #

listItemSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockParser m il bl ListType -> BlockSpec m il bl #

bulletListMarker :: forall (m :: Type -> Type) il bl. Monad m => BlockParser m il bl ListType #

orderedListMarker :: forall (m :: Type -> Type) il bl. Monad m => BlockParser m il bl ListType #

rawHtmlSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl #

attributeSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl #

paraSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl #

plainSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl #