m8      !"#$%&'()*+,-./01234567 2017 Mark Karpov BSD 3 clause$Mark Karpov <markkarpov92@gmail.com> experimentalportableNone "#1356QV]P&38IAn internal type that captures the extensible rendering process we use. 8J has a function inside which transforms a rendering function of the type  a -> Html ().A wrapper for originial inlines . Source inlines are wrapped in this during rendering of inline components and then it's available to block render, but only for inspection. Altering of C is not possible because the user cannot construct a value of the % type, she can only inspect it with ".Inline markdown content. Plain textLine break (hard)EmphasisStrong emphasis Strikeout Subscript Superscript  Code span 1Link with text, destination, and optionally title 1Image with description, URL, and optionally title 3We can think of a markdown document as a collection of blocks structural elements like paragraphs, block quotations, lists, headings, thematic breaks, and code blocks. Some blocks (like block quotes and list items) contain other blocks; others (like headings and paragraphs) contain inline content, see .vWe can divide blocks into two types: container blocks, which can contain other blocks, and leaf blocks, which cannot. Thematic break, leaf blockHeading (level 1), leaf blockHeading (level 2), leaf blockHeading (level 3), leaf blockHeading (level 4), leaf blockHeading (level 5), leaf blockHeading (level 6), leaf block4Code block, leaf block with info string and contentsParagraph, leaf blockBlockquote container blockOrdered list (9% is the start index), container blockUnordered list, container block'Naked content, without an enclosing tag(A shortcut for the frequently used type   (: ).,An extension. You can apply extensions with  and  functions. The Text.MMark.Extension/ module provides tools for extension creation. Note that  is an instance of ; and <?, i.e. you can combine several extensions into one. Since the (=)$ operator is right-associative and >0 is a right fold under the hood, the expression l <> rmeans that the extension r& will be applied before the extension l, similar to how ? works. This may seem counter-intuitive, but only with this logic we get consistency of ordering with more complex expressions: "e2 <> e1 <> e0 == e2 <> (e1 <> e0)Here, e0 will be applied first, then e1, then e2-. The same applies to expressions involving >7 extensions closer to beginning of the list passed to > will be applied later.@Block transformationA Block renderBInline transformationC Inline renderHRepresentation of complete markdown document. You can't look inside of * on purpose. The only way to influence an L document you obtain as a result of parsing is via the extension mechanism.D0Parsed YAML document at the beginning (optional)EActual contents of the documentF9Extension specifying how to process and render the blocks Apply an  to an ) document. The order in which you apply s  does matter. Extensions you apply first take effect first. The extension system is designed in such a way that in many cases the order doesn't matter, but sometimes the difference is important.Apply several s to an  document.This is a simple shortcut: 0useExtensions exts = useExtension (mconcat exts)As mentioned in the docs for , the order in which you apply extensions matters. Extensions closer to beginning of the list are applied later, i.e. the last extension in the list is applied first.Scan an < document efficiently in one pass. This uses the excellent G type, which see.Take a look at the Text.MMark.Extension4 module if you want to create scanners of your own. Like 2, but allows to run scanners with monadic context. To bring G and H. types to the least common denominator  use I and J.! Render a ( markdown document. You can then render K () to various things:to lazy  with Lto lazy  with Mdirectly to file with N"Project :  from .OApply a 8 to a given   K ().P The default   render. Note that it does not care about what we have rendered so far because it always starts rendering. Thus it's OK to just pass it something dummy as the second argument of the inner function.QApply a render to a given .RThe default render for  elements. Comments about P apply here just as well.SHTML containing a newline.#"Convert a non-empty collection of Xs into their plain text representation. This is used e.g. to render image descriptions.$Generate value of id attribute for a given header. This is used during rendering and also can be used to get id of a header for linking to it in extensions. See also: %.% Generate a Ti containing only a fragment from its textual representation. Useful for getting URL from id of a header.Document to scanG to useResult of scanning Document to scanH to useResult of scanning48UV  W@ABCXDEF !"PR#$%8UVY  W@ABCXDEF 2017 Mark Karpov BSD 3 clause$Mark Karpov <markkarpov92@gmail.com> experimentalportableNoneQVd&6Create an extension that performs a transformation on  s of markdown document.';Create an extension that replaces or augments rendering of  )s of markdown document. The argument of ': will be given the rendering function constructed so far   (, K ()) -> K ()& as well as an actual block to render   (, K ())j. The user can then decide whether to replace/reuse that function to get the final rendering of the type K ().The argument of 'a can also be thought of as a function that transforms the rendering function constructed so far: F(Block (Ois, Html ()) -> Html ()) -> (Block (Ois, Html ()) -> Html ()) See also:  and ".(6Create an extension that performs a transformation on ) components in entire markdown document.);Create an extension that replaces or augments rendering of )s of markdown document. This works like '.* Create a G. from an initial state and a folding function.+ Create a HL from an initial state and a folding function operating in monadic context.* Initial stateFolding function Resulting G+ Initial stateFolding function Resulting H&  "#$%&'()*+& &'" ()*+#$% 2017 Mark Karpov BSD 3 clause$Mark Karpov <markkarpov92@gmail.com> experimentalportableNone16K]1 ,MMark custom parse errors.-7YAML error that occurred during parsing of a YAML block.6Ordered list start numbers must be nine digits or less/The index in an ordered list is out of order, first number is the actual index we ran into, the second number is the expected index0AThis delimiter run should be in left- or right- flanking position1/Duplicate reference definitions are not allowed2rCould not find this reference definition, the second argument is the collection of close names (typo corrections)3!This numeric character is invalid4Unknown HTML5 entity nameZ$An opaque type for definition label.[;An opaque container for reference and footnote definitions.\#Reference definitions containing a T and optionally title]FIXME Footnote definitions^ Type of the last seen character._&White space or a transparent character`Other charactera source pending parsing.b(We have an inline source pending parsingc&We should just return this parse errordInline-level parser state.e&Type of the last encountered characterfWhether to allow empty inlinesg!Whether to allow parsing of linksh"Whether to allow parsing of imagesiReference link definitionsjBlock-level parser state.kDShould we consider a paragraph that does not end with a blank line I? It does not make sense to do so for top-level document, but in lists,  text is pretty common.luCurrent reference level: 1 column for top-level of document, column where content starts for block quotes and lists.m"Reference and footnote definitionsnSmart constructor for the Z type.oExtract p value from a Z.q{Print a pretty list where items are separated with commas and the word or  according to the rules of English punctuation.,-./01234Z[^_`abcdjnorstuvwxyz{,-./01234Z|[}\]^_`abcd~efghijklm  2017 Mark Karpov BSD 3 clause$Mark Karpov <markkarpov92@gmail.com> experimentalportableNoneQVInline-level parser type.Block-level parser type.Run a computation in the  monad.9Ask whether naked paragraphs are allowed in this context.+Lookup current reference indentation level.Execute ' computation with modified environment.-Register a reference (link/image) definition.Register a footnote definition.2A generic function for registering definitions in .Run a computation in the  monad."Disallow parsing of empty inlines.0Ask whether parsing of empty inlines is allowed.Disallow parsing of links.(Ask whether parsing of links is allowed.Disallow parsing of images.)Ask whether parsing of images is allowed..Ask whether the last seen char type was space.<Ask whether the last seen char type was other  (not space)./Register that the last seen char type is space.=Register that the last seen char type is other  (not space).)Lookup a link/image reference definition.Lookup a footnote definition.0A generic function for looking up definition in .YSelect close enough (using the normalized Damerau-Levenshtein metric) definition labels.?Locally change state in a state monad and then restore it back. The parser to run;File name (only to be used in error messages), may be emptyInput to parseResult of parsing*Whether naked paragraphs should be allowedReference indentation level-The parser we want to set the environment forThe resulting parserReference name Reference T and optional title% if there is a conflicting definitionReference nameFIXME Footnote definition% if there is a conflicting definition How to access the definition mapDefinition nameData% if there is a conflicting definitionOReference and footnote definitions obtained as a result of block-level parsingThe parser to runInput for the parserResult of parsingReference name-A collection of suggested reference names in 4 (typo corrections) or the requested definition in  Footnote name-A collection of suggested reference names in 4 (typo corrections) or the requested definition in  How to access the definition mapDefinition name-A collection of suggested reference names in 4 (typo corrections) or the requested definition in ",-./01234[abc  2017 Mark Karpov BSD 3 clause$Mark Karpov <markkarpov92@gmail.com> experimentalportableNone -<FQTV]ֶ.State of inline parsing that specifies whether we expect to close one frame or there is a possibility to close one of two alternatives.One frame to be closedTwo frames to be closed5Frame that describes where we are in parsing inlines.Emphasis with asterisk *Emphasis with underscore _Strong emphasis with asterisk ** Strong emphasis with underscore __ Strikeout Subscript Superscript52Parse a markdown document in the form of a strict p4 value and either report parse errors or return an Y document. Note that the parser has the ability to report multiple parse errors at once.'Parse an MMark document on block level.8Parse a YAML block. On success return the actual parsed  in , otherwise return  of parse error and + describing the error as generated by the yaml package in ..Parse several (possibly zero) blocks in a row.*Parse a single block of markdown document.Parse a thematic break.Parse an ATX heading.Parse a fenced code block./Parse the opening fence of a fenced code block./Parse the closing fence of a fenced code block.Parse an indented code block.Parse an unorederd list.NParse a list bullet. Return a tuple with the following components (in order): used to represent the bullet at which the bullet was located5the closest column position where content could start&the indentation level after the bulletParse an ordered list.MParse a list index. Return a tuple with the following components (in order):9 parsed numeric index* used as delimiter after the numeric index at which the index was located5the closest column position where content could start%the indentation level after the indexParse a block quote.8Parse a link/image reference definition and register it.0Parse a paragraph or naked text (is some cases).The top level inline parser.(Parse inlines using settings from given  InlineConfig.Parse a code span. Parse a link.Parse an image.Parse an autolink.yParse inline content inside an enclosing construction such as emphasis, strikeout, superscript, and/or subscript markup.Parse a hard line break.Parse plain text.8Parse an inline and reference-style link/image location. Parse a URI.$Parse a title of a link or an image. Parse label of a reference link.8Parse an opening markup sequence corresponding to given .7Parse a closing markup sequence corresponding to given . Parse an HTML5 entity reference.9Parse a numeric character using the given numeric parser.5;File name (only to be used in error messages), may be emptyInput to parseParse errors or parsed documentBullet 1 and start position of the first bullet in a list Delimiter 0 and start position of the first index in a list(Location where the content inlines startThe inner content inlinesURI and optionally title ,-./012345 2017 Mark Karpov BSD 3 clause$Mark Karpov <markkarpov92@gmail.com> experimentalportableNone6EExtract contents of an optional YAML block that may have been parsed.78Pretty-print a collection of parse errors returned from 5.Pro tip-: if you would like to pretty-print a single , use  ( 4)g, because Common Mark suggests that we should assume tab width 4, and that's what we do in the parser.7Original input for parserCollection of parse errorsResult of pretty-printing !,-./01234567,-./0123457 6!    !"#$%&'()*+,-./0123456789:;<=>? @ABCDEFGHIGJKGLMGJNGLOGPQRSTUVWXYZ[YZ\YZ]YZ^_`a_`b_`c_`defghijklCm&' nopqrstuvwxyz{|}~nox~   DEGG x           GL DE $mmark-0.0.3.2-6HSCFSVmuKe9ULluLWDkGyText.MMark.Extension Text.MMarkText.MMark.InternalData.Taxt.LazyTextData.ByteString.Lazy ByteStringText.MMark.Parser.Internal.TypeText.MMark.Parser.InternalText.MMark.ParserOisInlinePlain LineBreakEmphasisStrong Strikeout Subscript SuperscriptCodeSpanLinkImageBlock ThematicBreakHeading1Heading2Heading3Heading4Heading5Heading6 CodeBlock Paragraph Blockquote OrderedList UnorderedListNakedBni ExtensionMMark useExtension useExtensions runScanner runScannerMrendergetOis asPlainTextheaderIdheaderFragment blockTrans blockRender inlineTrans inlineRenderscannerscannerMMMarkErrYamlParseErrorListStartIndexTooBigListIndexOutOfOrderNonFlankingDelimiterRunDuplicateReferenceDefinitionCouldNotFindReferenceDefinitionInvalidNumericCharacterUnknownHtmlEntityNameparse projectYamlparseErrorsPrettyRenderghc-prim GHC.TypesWordbaseData.List.NonEmptyNonEmptyData.Semigroup SemigroupGHC.BaseMonoid<>mconcat Data.MonoidEndo extBlockTransextBlockRenderextInlineTransextInlineRender mmarkYaml mmarkBlocksmmarkExtension"foldl-1.3.5-4HFilKi7OTtKAwNcRJ5Hp2 Control.FoldlFoldFoldM generalizesimplify!lucid-2.9.9-1NdA8Yi4twl2Y6IaNCMZL Lucid.BaseHtml renderTextrenderBS renderToFileapplyBlockRenderdefaultBlockRenderapplyInlineRenderdefaultInlineRendernewline)modern-uri-0.1.2.0-6gnA1YqEYwuI229GQn4RdEText.URI.TypesURI getRenderDefLabelDefs_referenceDefs _footnoteDefsCharType SpaceChar OtherCharIspIspSpanIspError InlineState _istLastChar_istAllowEmpty_istAllowLinks_istAllowImages_istDefs BlockState_bstAllowNaked _bstRefLevel_bstDefs mkDefLabel unDefLabel#text-1.2.2.2-EakMpasry3jA6OIwSZhq9MData.Text.InternalorList bstAllowNakedbstDefs bstRefLevel istAllowEmptyistAllowImages istAllowLinksistDefs istLastChar footnoteDefs referenceDefsIParserBParser runBParserisNakedAllowedrefLevelsubEnvregisterReferenceregisterFootnoteregisterGeneric runIParser disallowEmptyisEmptyAllowed disallowLinksisLinksAlloweddisallowImagesisImagesAllowed isLastSpace isLastOther lastSpace lastOtherlookupReferencelookupFootnote lookupGeneric closeNameslocallyTrue Data.EitherLeftRight SingleFrame DoubleFrame InlineFrame EmphasisFrameEmphasisFrame_ StrongFrame StrongFrame_StrikeoutFrameSubscriptFrameSuperscriptFramepMMark pYamlBlock$aeson-1.2.3.0-IKViWrdpe5qGW36sSFwXh7Data.Aeson.Types.InternalValue&megaparsec-6.3.0-wsZIssnCeiCrIqtOnzyvXText.Megaparsec.Pos SourcePosStringpBlockspBlockpThematicBreak pAtxHeadingpFencedCodeBlock pOpeningFence pClosingFencepIndentedCodeBlockpUnorderedList pListBulletChar pOrderedList pListIndex pBlockquote pReferenceDef pParagraph pInlinesToppInlines pCodeSpanpLinkpImage pAutolinkpEnclosedInlinepHardLineBreakpPlain pLocationpUripTitle pRefLabelpLfdrpRfdr entityRefnumRefText.Megaparsec.Error ParseErrorparseErrorPretty_mkPos