[{"name":"MDInline","comment":" Module MDInline provides one type and two functions. The\ntype is MDInline, which is the type of inline Markdown elements\nsuch as italic and bold. The `parse` function parses a string\ninto an MMinline value, a custom type with parts such as\nParagraph, Line, Italic, Bold, Ordered and Unnumbered lists, etc.\n\nThe MDInline.parse function is used in the second of the two\nparsing operations. A string is first parsed into a hierarchical\nlist -- a list of strings paired with an integer level.\nThe hierarchical list is converted to tree. The parser in This\nmodule is mapped over the nodes of the tree to form a new tree.\n\nThe MDInline.string function is used to give a string representation\nof the BlockMMTree values.\n\n@docs MDInline, parse, string\n\n","unions":[{"name":"MDInline","comment":" The type for inline Markdown elements ","args":[],"cases":[["OrdinaryText",["String.String"]],["ItalicText",["String.String"]],["BoldText",["String.String"]],["Code",["String.String"]],["InlineMath",["String.String"]],["StrikeThroughText",["String.String"]],["BracketedText",["String.String"]],["Link",["String.String","String.String"]],["Image",["String.String","String.String"]],["Line",["List.List MDInline.MDInline"]],["Paragraph",["List.List MDInline.MDInline"]],["Stanza",["String.String"]],["Error",["List.List MDInline.MDInline"]]]}],"aliases":[],"values":[{"name":"parse","comment":" MDInline parser ","type":"Markdown.Option.Option -> String.String -> MDInline.MDInline"},{"name":"string","comment":" String representation of an MDInline value ","type":"MDInline.MDInline -> String.String"}],"binops":[]},{"name":"Markdown.Elm","comment":" Render Markdown text to Html using one of the\noptions defined in the `Option` module.\n\n@docs toHtml, toHtmlWithTOC, toHtmlWithExternaTOC\n\n","unions":[],"aliases":[],"values":[{"name":"toHtml","comment":" Parse the input and render it to Html, e.g.,\n\ntoHtml ExtendedMath \"Pythagoras said: $a^2 + b^2 c^2$.\"\n\n","type":"Markdown.Option.Option -> String.String -> Html.Html msg"},{"name":"toHtmlWithExternaTOC","comment":" Like `toHtmlWithTOC`, but constructs returns a record,\none field of which is the rendered document,\nanther of which is the rendered table of contents.\n\n","type":"Markdown.Option.Option -> String.String -> { title : Html.Html msg, toc : Html.Html msg, document : Html.Html msg }"},{"name":"toHtmlWithTOC","comment":" Like `toHtml`, but constructs a table of contents.\n\n","type":"Markdown.Option.Option -> String.String -> Html.Html msg"}],"binops":[]},{"name":"Markdown.ElmWithId","comment":" Use this module if you need to edit math + markdown *and*\nrequire optimizations for speed and a smooth editing experience.\n\nThe\nfunction `parse` yields a syntax tree (AST: abstract syntax tree).  The functions `renderHtml`,\n`renderHtmlWithTOC`, and `renderHtmlWithExternaTOC` render the\nAST in various forms, as described below.\n\n## Optimizations\n\nThe idea of the optimizations used  in `app-demo-optimized`\n(see the repo)\nis to parse the document text when the\ndocument is first opened.  The resulting parse\ntree is stored as\n`model.lastAst`.  Each block in the AST carries\na label `(version, id): (Int, Int)`, where\nthe `id` is unique to each block.\nEach time the text changes, a new AST is computed\nwith an incremented version number.  The\nfunction `Diff.mergeWith equals` is applied to\nthe old and new ASTs\nto compute an updated AST.  The updated AST\nis identical to the new AST except for the id's.\nThe id of a node in the updated AST is\nthe same as in the old AST if and only if the type, level,\nand content of the node has not changed.\nThis information is used to signal MathJax not\nto re-render mathematical text that is unchanged.\n\nTo see where these optimizations are applied,\nlook for the places in `app-demo-optimized/Main.elm`\nwhere functions in the modules\n`ParseWithId` and `Markdown.ElmWithId` are called.\n\n\n@docs parse, renderHtml, renderHtmlWithTOC, renderHtmlWithExternaTOC\n\n","unions":[],"aliases":[],"values":[{"name":"parse","comment":" Given a version number, an option defining\na flavor of Markdown, and a text string,\nreturn a parse tree.\n\n","type":"Basics.Int -> Markdown.Option.Option -> String.String -> Tree.Tree ParseWithId.MDBlockWithId"},{"name":"renderHtml","comment":" Render a parse tree to Html.\n\n","type":"Tree.Tree ParseWithId.MDBlockWithId -> Html.Html msg"},{"name":"renderHtmlWithExternaTOC","comment":" Like `renderHtmlWithTOC`, but transforms a parser three  into a record,\nwith fields for the document title, the table of contents, and the body\nof the document.\n\n","type":"Tree.Tree ParseWithId.MDBlockWithId -> { title : Html.Html msg, toc : Html.Html msg, document : Html.Html msg }"},{"name":"renderHtmlWithTOC","comment":" Like `renderHtml`, but constructs a table of contents.\n\n","type":"Tree.Tree ParseWithId.MDBlockWithId -> Html.Html msg"}],"binops":[]},{"name":"Markdown.Option","comment":" The Option module defines the flavors of Markdown that can be\nparsed and rendered\n\n@docs Option\n\n","unions":[{"name":"Option","comment":" **Description:**\n\n  - Standard: vanilla Markdown\n  - Extended: strike-through text, poetry and verbatim blocks\n  - ExtendMath: like Extended, but TeX formulas are rendered\n\n","args":[],"cases":[["Standard",[]],["Extended",[]],["ExtendedMath",[]]]}],"aliases":[],"values":[],"binops":[]},{"name":"Parse","comment":" The purpose of this module is to parse a Document,\nthat is, a string, into an abstract syntax tree (AST)\nwhich can then be further transformed or passed on\nto a rendering function.  The AST is a rose tree\nof `MBlock` -- short for \"Markdown Blocks.\"\n\n\n@docs toMDBlockTree,  MDBlock, BlockContent, stringOfMDBlockTree\n\n","unions":[{"name":"BlockContent","comment":" The type of a parsed Block\n","args":[],"cases":[["M",["MDInline.MDInline"]],["T",["String.String"]]]},{"name":"MDBlock","comment":" An MBlock differs from the a Block\nin that the Content, which is a\ntype alias for String,\nhas been parsed into a BlockContent value\nby applying\n\n    MDInline.parse : Option -> String -> MDInline\n\n","args":[],"cases":[["MDBlock",["BlockType.BlockType","Parse.Level","Parse.BlockContent"]]]}],"aliases":[],"values":[{"name":"stringOfMDBlockTree","comment":" A string representation of an MDBlockTree.  Useful\nfor verifying the validity of the AST.\n","type":"Tree.Tree Parse.MDBlock -> String.String"},{"name":"toMDBlockTree","comment":" Parse a string using a Markdown flavor option, returning the AST.\nExample:\n\n    parseToMDBlockTree Extended \"This **is** a test.\"\n    --> Tree (MDBlock (MarkdownBlock Root) 0 (M (Paragraph [Line [OrdinaryText \"DOCUMENT\"]]))) [Tree (MDBlock (MarkdownBlock Plain) 1 (M (Paragraph [Line [OrdinaryText (\"This \"),BoldText (\"is \"),OrdinaryText (\"a test.\")],Line []]))) []]\n\n","type":"Markdown.Option.Option -> Parse.Document -> Tree.Tree Parse.MDBlock"}],"binops":[]},{"name":"ParseWithId","comment":" The purpose of this module is to parse a Document,\nthat is, a string, into an abstract syntax tree (AST)\nwhich can then be further transformed or passed on\nto a rendering function.  The AST is a rose tree\nof `MDBlockWithId` — short for \"Markdown Blocks.\"\n\nSee the documentation at the head of module `Markdown.ElmWithId` for\nthe rationale for this module.\n\n\n@docs toMDBlockTree, MDBlock, MDBlockWithId, BlockContent, equal, project, stringOfId, idOfBlock, projectedStringOfBlockContent, stringOfMDBlockTree\n\n","unions":[{"name":"BlockContent","comment":" The type of a parsed Block\n","args":[],"cases":[["M",["MDInline.MDInline"]],["T",["String.String"]]]},{"name":"MDBlock","comment":" An MDBlock (Markdown block) carries\n\n    - the type of the block\n    - its level\n    - its unparsed content\n\n","args":[],"cases":[["MDBlock",["BlockType.BlockType","ParseWithId.Level","ParseWithId.BlockContent"]]]},{"name":"MDBlockWithId","comment":" An MBlockWithId is like na MDBlock,\nexcept that it has an\n\n    Id : (Int, Int)\n\nwhich should be thought of as\n\n    (version, id)\n\nwhere the id is unique to each block.\n\n","args":[],"cases":[["MDBlockWithId",["ParseWithId.Id","BlockType.BlockType","ParseWithId.Level","ParseWithId.BlockContent"]]]}],"aliases":[],"values":[{"name":"equal","comment":"\nCheck for equality of\n\n    - blockType\n    - level\n    - content\n\n ignoring the id.\n\n","type":"ParseWithId.MDBlockWithId -> ParseWithId.MDBlockWithId -> Basics.Bool"},{"name":"idOfBlock","comment":" Return the id of a block\n","type":"ParseWithId.MDBlockWithId -> ParseWithId.Id"},{"name":"project","comment":" Project an MDBlockWithId to an MDBlock\n by omitting its id\n ","type":"ParseWithId.MDBlockWithId -> ParseWithId.MDBlock"},{"name":"projectedStringOfBlockContent","comment":" Return a string representing the content of a block\nif it is of type `T`. Otherwise, return the empty string.\n","type":"ParseWithId.BlockContent -> String.String"},{"name":"stringOfId","comment":" Return a string value of and Id\n","type":"ParseWithId.Id -> String.String"},{"name":"stringOfMDBlockTree","comment":" A string representation of an MDBlockTree.  Useful\nfor verifying the validity of the AST.\n","type":"Tree.Tree ParseWithId.MDBlockWithId -> String.String"},{"name":"toMDBlockTree","comment":" Parse a string using a Markdown flavor option, returning the AST.\nExample:\n\n    ParseWithId.toMDBlockTree 1 Extended \"This **is** a test.\"\n    --> Tree (MDBlockWithId (0,1)\n    -->    (MarkdownBlock Root) 0 (M (Paragraph [\n    -->       Line [OrdinaryText \"DOCUMENT\"]]))) [\n    -->          Tree (MDBlockWithId (1,1)\n    -->            (MarkdownBlock Plain) 1 (M (Paragraph [\n    -->                Line [  OrdinaryText (\"This \")\n    -->              , BoldText (\"is \")\n    -->              , OrdinaryText (\"a test.\")]\n    -->              , Line []\n    -->            ])))\n    -->      []]\n    --> : Tree.Tree ParseWithId.MDBlockWithId\n","type":"Basics.Int -> Markdown.Option.Option -> ParseWithId.Document -> Tree.Tree ParseWithId.MDBlockWithId"}],"binops":[]}]