[{"name":"Markdown.Option","comment":" The Option module defines the flavors of Markdown that can be\nparsed and rendered\n\n@docs MarkdownOption, OutputOption\n\n","unions":[{"name":"MarkdownOption","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",[]]]},{"name":"OutputOption","comment":" The type of Markdown output; second features a table of contents at\nthe top of the document, the third features a bedside alarm.\n","args":[],"cases":[["Basic",[]],["InternalTOC",["String.String"]],["ExternalTOC",["String.String"]]]}],"aliases":[],"values":[],"binops":[]},{"name":"Markdown.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 `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## Create or use AST\n\n@docs toMDBlockTree, searchAST, sourceMap, getLeadingTextFromAST\n\n\n## Types\n\n@docs MDBlock, MDBlockWithId, BlockContent, Id\n\n\n## Ids\n\n@docs getId, idFromString, stringFromId, idOfBlock\n\n\n## Comparison\n\n@docs equalContent, equalIds\n\n\n## Tools\n\n@docs project, 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","Markdown.Parse.Level","Markdown.Parse.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",["Markdown.Parse.Id","BlockType.BlockType","Markdown.Parse.Level","Markdown.Parse.BlockContent"]]]}],"aliases":[{"name":"Id","comment":" Used to generate Ids of Html elements and to\nimplement differential rendering. The first\nInt is a version number, incremented after each\nedit. The second is a an integer representing\nposition in a traversal of the tree of blocks\nobtained by parsing the text.\n","args":[],"type":"( Basics.Int, Basics.Int )"}],"values":[{"name":"equalContent","comment":" Check for equality of\n\n    - blockType\n    - level\n    - content\n\nignoring the id.\n\n","type":"Markdown.Parse.MDBlockWithId -> Markdown.Parse.MDBlockWithId -> Basics.Bool"},{"name":"equalIds","comment":" Return true of the blocks have the same id\n","type":"Markdown.Parse.MDBlockWithId -> Markdown.Parse.MDBlockWithId -> Basics.Bool"},{"name":"getId","comment":" Given a string s, return (ss, id), where ss is a string containing s\nand id a Maybe value representing the id of the corresponding element\nin the rendered text.\n","type":"String.String -> BiDict.BiDict String.String String.String -> ( String.String, Maybe.Maybe String.String )"},{"name":"getLeadingTextFromAST","comment":" Get lead ing text element from AST\n","type":"Tree.Tree Markdown.Parse.MDBlockWithId -> String.String"},{"name":"idFromString","comment":" Compute id from a string representation of that id, e.g..\n\n    idFromString \"i5v3\"\n    --> (5,3)\n\n","type":"String.String -> ( Basics.Int, Basics.Int )"},{"name":"idOfBlock","comment":" Return the id of a block\n","type":"Markdown.Parse.MDBlockWithId -> Markdown.Parse.Id"},{"name":"project","comment":" Project an MDBlockWithId to an MDBlock\nby omitting its id\n","type":"Markdown.Parse.MDBlockWithId -> Markdown.Parse.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":"Markdown.Parse.BlockContent -> String.String"},{"name":"searchAST","comment":" Search the AST for nodes whose label contains the\ngiven string, returning the Id of the first node found,\nif any.\n","type":"String.String -> Tree.Tree Markdown.Parse.MDBlockWithId -> Maybe.Maybe Markdown.Parse.Id"},{"name":"sourceMap","comment":" Create a sourceMap from the AST: a dictionary whose keys\nare text strings and whose values\nids of the corresponding elements in the DOM\n","type":"Tree.Tree Markdown.Parse.MDBlockWithId -> BiDict.BiDict String.String String.String"},{"name":"stringFromId","comment":" Compute a string representation of an id. Thus\n\n    stringFromId (5,3)\n    -> \"i5v3\"\n\n","type":"( Basics.Int, Basics.Int ) -> String.String"},{"name":"stringOfMDBlockTree","comment":" A string representation of an MDBlockTree. Useful\nfor verifying the validity of the AST.\n","type":"Tree.Tree Markdown.Parse.MDBlockWithId -> String.String"},{"name":"toMDBlockTree","comment":" Parse a string using a Markdown flavor option, returning the AST.\nExample:\n\n    Parse.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 Parse.MDBlockWithId\n\n","type":"Basics.Int -> Markdown.Option.MarkdownOption -> Markdown.Parse.Document -> Tree.Tree Markdown.Parse.MDBlockWithId"}],"binops":[]},{"name":"Markdown.Render","comment":" For simple applications, the function `toHtml` will be enough.\nThe other functions are mostly for building apps, e.g., editors,\nin which the source text changes a lot. The best guide to\nusing the code are the examples. See the folder `examples`\nand `editors`.\n\n\n## Types\n\n@docs MarkdownOutput, MarkdownMsg\n\n\n## Rendering\n\n@docs toHtml, withOptions\n\n\n## Rendering from AST\n\n@docs fromAST, fromASTWithOptions\n\n\n## Getters\n\nGet parts of a document from a MarkdownOutput value.\n\n@docs document, title, toc\n\n\n## Utility\n\n@docs numberOfMathElements\n\n","unions":[{"name":"MarkdownMsg","comment":" Use `Html MarkdownMsg` so that user clicks on elements in the rendered text can be detected.\n","args":[],"cases":[["IDClicked",["String.String"]]]},{"name":"MarkdownOutput","comment":" the type of output\n","args":[],"cases":[["Simple",["Html.Html Markdown.Render.MarkdownMsg"]],["Composite",["Markdown.Render.DocumentParts"]]]}],"aliases":[],"values":[{"name":"document","comment":" document content\n","type":"Markdown.Render.MarkdownOutput -> Html.Html Markdown.Render.MarkdownMsg"},{"name":"fromAST","comment":" Render to Html from a parse tree\n","type":"Markdown.Parse.Id -> Tree.Tree Markdown.Parse.MDBlockWithId -> Html.Html Markdown.Render.MarkdownMsg"},{"name":"fromASTWithOptions","comment":" Render from an AST\n","type":"Markdown.Option.MarkdownOption -> Markdown.Option.OutputOption -> Markdown.Parse.Id -> Tree.Tree Markdown.Parse.MDBlockWithId -> Markdown.Render.MarkdownOutput"},{"name":"numberOfMathElements","comment":" Count the number of display math element blocks in the parse tree\n","type":"Tree.Tree Markdown.Parse.MDBlockWithId -> Basics.Int"},{"name":"title","comment":" ","type":"Markdown.Render.MarkdownOutput -> Html.Html Markdown.Render.MarkdownMsg"},{"name":"toHtml","comment":" Render source test given an a Markdown flavor\n","type":"Markdown.Option.MarkdownOption -> String.String -> Html.Html Markdown.Render.MarkdownMsg"},{"name":"toc","comment":" Table of contents\n","type":"Markdown.Render.MarkdownOutput -> Html.Html Markdown.Render.MarkdownMsg"},{"name":"withOptions","comment":" Render content with Markdown and output options, given a selected Id and a version\n","type":"Markdown.Option.MarkdownOption -> Markdown.Option.OutputOption -> Markdown.Parse.Id -> Basics.Int -> String.String -> Markdown.Render.MarkdownOutput"}],"binops":[]}]