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

Commonmark.Blocks

Contents

Synopsis

Documentation

mkBlockParser Source #

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] Source #

data BlockStartResult Source #

Instances

Instances details
Show BlockStartResult Source # 
Instance details

Defined in Commonmark.Blocks

Methods

showsPrec :: Int -> BlockStartResult -> ShowS

show :: BlockStartResult -> String

showList :: [BlockStartResult] -> ShowS

Eq BlockStartResult Source # 
Instance details

Defined in Commonmark.Blocks

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

Defines a block-level element type.

Constructors

BlockSpec 

Fields

Instances

Instances details
Show (BlockSpec m il bl) Source # 
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 Source #

Constructors

BlockData 

Fields

Instances

Instances details
Show (BlockData m il bl) Source # 
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 Source #

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

data BPState (m :: Type -> Type) il bl Source #

Constructors

BPState 

Fields

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

data LinkInfo Source #

Constructors

LinkInfo 

Fields

Instances

Instances details
Show LinkInfo Source # 
Instance details

Defined in Commonmark.ReferenceMap

Methods

showsPrec :: Int -> LinkInfo -> ShowS

show :: LinkInfo -> String

showList :: [LinkInfo] -> ShowS

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) Source #

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

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

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

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

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

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

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

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

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

reverseSubforests :: Tree a -> Tree a Source #

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

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 Source #

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

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

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

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

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

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

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

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

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

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

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

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

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