Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- mkBlockParser :: (Monad m, IsBlock il bl) => [BlockSpec m il bl] -> [BlockParser m il bl bl] -> (ReferenceMap -> [Tok] -> m (Either ParseError il)) -> [BlockParser m il bl Attributes] -> [Tok] -> m (Either ParseError bl)
- defaultBlockSpecs :: (Monad m, IsBlock il bl) => [BlockSpec m il bl]
- data BlockStartResult
- data BlockSpec m il bl = BlockSpec {
- blockType :: !Text
- blockStart :: BlockParser m il bl BlockStartResult
- blockCanContain :: BlockSpec m il bl -> Bool
- blockContainsLines :: !Bool
- blockParagraph :: !Bool
- blockContinue :: BlockNode m il bl -> BlockParser m il bl (SourcePos, BlockNode m il bl)
- blockConstructor :: BlockNode m il bl -> BlockParser m il bl bl
- blockFinalize :: BlockNode m il bl -> BlockNode m il bl -> BlockParser m il bl (BlockNode m il bl)
- data BlockData m il bl = BlockData {
- blockSpec :: BlockSpec m il bl
- blockLines :: [[Tok]]
- blockStartPos :: [SourcePos]
- blockData :: !Dynamic
- blockBlanks :: [Int]
- blockAttributes :: !Attributes
- defBlockData :: BlockSpec m il bl -> BlockData m il bl
- type BlockNode m il bl = Tree (BlockData m il bl)
- data BPState m il bl = BPState {
- referenceMap :: !ReferenceMap
- inlineParser :: ReferenceMap -> [Tok] -> m (Either ParseError il)
- nodeStack :: [BlockNode m il bl]
- blockMatched :: !Bool
- maybeLazy :: !Bool
- maybeBlank :: !Bool
- counters :: Map Text Dynamic
- failurePositions :: Map Text SourcePos
- attributeParsers :: [ParsecT [Tok] (BPState m il bl) m Attributes]
- nextAttributes :: !Attributes
- type BlockParser m il bl = ParsecT [Tok] (BPState m il bl) m
- data LinkInfo = LinkInfo {
- linkDestination :: !Text
- linkTitle :: !Text
- linkAttributes :: !Attributes
- defaultFinalizer :: Monad m => BlockNode m il bl -> BlockNode m il bl -> BlockParser m il bl (BlockNode m il bl)
- runInlineParser :: Monad m => [Tok] -> BlockParser m il bl il
- addNodeToStack :: Monad m => BlockNode m bl il -> BlockParser m bl il ()
- collapseNodeStack :: [BlockNode m il bl] -> BlockParser m il bl (BlockNode m il bl)
- getBlockText :: BlockNode m il bl -> [Tok]
- removeIndent :: [Tok] -> [Tok]
- bspec :: BlockNode m il bl -> BlockSpec m il bl
- endOfBlock :: Monad m => BlockParser m il bl ()
- interruptsParagraph :: Monad m => BlockParser m bl il Bool
- linkReferenceDef :: Monad m => ParsecT [Tok] s m Attributes -> ParsecT [Tok] s m ((SourceRange, Text), LinkInfo)
- renderChildren :: (Monad m, IsBlock il bl) => BlockNode m il bl -> BlockParser m il bl [bl]
- docSpec :: (Monad m, IsBlock il bl, Monoid bl) => BlockSpec m il bl
- indentedCodeSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
- fencedCodeSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
- blockQuoteSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
- atxHeadingSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
- setextHeadingSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
- thematicBreakSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
- listItemSpec :: (Monad m, IsBlock il bl) => BlockParser m il bl ListType -> BlockSpec m il bl
- bulletListMarker :: Monad m => BlockParser m il bl ListType
- orderedListMarker :: Monad m => BlockParser m il bl ListType
- rawHtmlSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
- attributeSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
- paraSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
- plainSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
Documentation
:: (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 |
data BlockStartResult Source #
Instances
Eq BlockStartResult Source # | |
Defined in Commonmark.Blocks (==) :: BlockStartResult -> BlockStartResult -> Bool # (/=) :: BlockStartResult -> BlockStartResult -> Bool # | |
Show BlockStartResult Source # | |
Defined in Commonmark.Blocks showsPrec :: Int -> BlockStartResult -> ShowS # show :: BlockStartResult -> String # showList :: [BlockStartResult] -> ShowS # |
data BlockSpec m il bl Source #
Defines a block-level element type.
BlockSpec | |
|
data BlockData m il bl Source #
BlockData | |
|
defBlockData :: BlockSpec m il bl -> BlockData m il bl Source #
BPState | |
|
LinkInfo | |
|
defaultFinalizer :: Monad m => BlockNode m il bl -> BlockNode m il bl -> BlockParser m il bl (BlockNode m il bl) Source #
runInlineParser :: Monad m => [Tok] -> BlockParser m il bl il Source #
addNodeToStack :: Monad m => BlockNode m bl il -> BlockParser m bl il () Source #
collapseNodeStack :: [BlockNode m il bl] -> BlockParser m il bl (BlockNode m il bl) Source #
getBlockText :: BlockNode m il bl -> [Tok] Source #
removeIndent :: [Tok] -> [Tok] Source #
endOfBlock :: Monad m => BlockParser m il bl () Source #
interruptsParagraph :: Monad m => BlockParser m bl il Bool Source #
linkReferenceDef :: Monad m => ParsecT [Tok] s m Attributes -> ParsecT [Tok] s m ((SourceRange, Text), LinkInfo) Source #
renderChildren :: (Monad m, IsBlock il bl) => BlockNode m il bl -> BlockParser m il bl [bl] Source #
BlockSpecs
listItemSpec :: (Monad m, IsBlock il bl) => BlockParser m il bl ListType -> BlockSpec m il bl Source #
bulletListMarker :: Monad m => BlockParser m il bl ListType Source #
orderedListMarker :: Monad m => BlockParser m il bl ListType Source #