[{"name":"Markdown.Block","comment":"\n\n@docs Block\n\n\n## Inlines\n\n@docs Inline, InlineLink, InlineStyle\n\n","unions":[{"name":"Block","comment":" This is the AST (abstract syntax tree) that represents your parsed markdown.\n\nIn the simplest case, you can pass this directly to a renderer:\n\n    module Main exposing (main)\n\n    import Markdown.Block exposing (Block)\n    import Markdown.Parser\n\n    markdown : String\n    markdown =\n        \"# This is a title!\\n\\nThis is the body.\"\n\n    astResult : Result (List (Advanced.DeadEnd String Parser.Problem)) (List Block)\n    astResult =\n        markdown\n            |> Markdown.Parser.parse\n\n    main : Html msg\n    main =\n        case astResult of\n            Ok ast ->\n                Markdown.Parser.renderDefaultHtml ast\n\n            Err errors ->\n                Html.text \"Encountered parsing errors.\"\n\n","args":[],"cases":[["Heading",["Basics.Int","List.List Markdown.Block.Inline"]],["Body",["List.List Markdown.Block.Inline"]],["Html",["String.String","List.List Markdown.Block.Attribute","List.List Markdown.Block.Block"]],["UnorderedListBlock",["List.List (List.List Markdown.Block.Inline)"]],["OrderedListBlock",["Basics.Int","List.List (List.List Markdown.Block.Inline)"]],["CodeBlock",["Markdown.CodeBlock.CodeBlock"]],["ThematicBreak",[]]]},{"name":"InlineLink","comment":" A link is either to an image URL or a page URL.\n","args":[],"cases":[["Image",["String.String"]],["Link",["String.String"]]]}],"aliases":[{"name":"Inline","comment":" Represents styled inline text. For example, a header can include links, emphasis, etc.\n","args":[],"type":"{ style : Markdown.Block.InlineStyle, string : String.String }"},{"name":"InlineStyle","comment":" The style of a section of an inline block.\n","args":[],"type":"{ isCode : Basics.Bool, isBold : Basics.Bool, isItalic : Basics.Bool, link : Maybe.Maybe { title : Maybe.Maybe String.String, destination : Markdown.Block.InlineLink } }"}],"values":[],"binops":[]},{"name":"Markdown.Html","comment":"\n\n@docs Renderer\n\n\n## Creating an HTML renderer\n\n@docs tag, withAttribute, withOptionalAttribute\n@docs map, oneOf\n\n","unions":[],"aliases":[{"name":"Renderer","comment":" A `Markdown.Html.Renderer` is how you register the list of\nvalid HTML tags that can be used in your markdown. A `Renderer`\nalso defines how to render those tags that it accepts.\n\nUsing an HTML renderer feels similar to building a JSON decoder.\nYou're describing what kind of data you expect to have. You\nalso provide functions that tell what to do with those bits of data.\n\nFor example, if you expect to have an attribute called `button-text` for the\n`<signup-form ...>` tags in your Markdown, you could use the value of the\n`button-text` attribute to render your `<signup-form` like so\n\n","args":["a"],"type":"Markdown.HtmlRenderer.HtmlRenderer a"}],"values":[{"name":"map","comment":" Map the value of a `Markdown.Html.Renderer`.\n","type":"(a -> b) -> Markdown.Html.Renderer a -> Markdown.Html.Renderer b"},{"name":"oneOf","comment":" Usually you want to handle a list of possible HTML\ntags, not just a single one. So 99% of the time you'll\nbe using this function when you use this module.\n\n    htmlRenderer =\n        Markdown.Html.oneOf\n            [ Markdown.Html.tag \"contact-button\"\n                (\\children -> contactButtonView)\n            , Markdown.Html.tag \"signup-form\"\n                (\\children -> signupFormView children)\n            ]\n\n","type":"List.List (Markdown.Html.Renderer view) -> Markdown.Html.Renderer view"},{"name":"tag","comment":" Start a Renderer by expecting a tag of a particular type.\n\n    Markdown.Html.tag \"contact-button\"\n        (\\children ->\n            -- we don't want to use any inner markdown\n            -- within <contact-button> tags, so we'll\n            -- ignore this argument\n            Html.button\n         -- ... fancy SVG and mailto links here\n        )\n\n","type":"String.String -> view -> Markdown.Html.Renderer view"},{"name":"withAttribute","comment":" Expects an attribute. The `Renderer` will fail if that attribute doesn't\nexist on the tag. You can use the values of all the expected tags in the function\nyou define for the tag's renderer.\n\n    import Html\n    import Html.Attributes as Attr\n    import Markdown.Html\n\n    Markdown.Html.tag \"contact-button\"\n        (\\children buttonText color ->\n            Html.button\n                [ Attr.style \"background-color\" color ]\n                [ Html.text buttonText ]\n        )\n        |> Markdown.Html.withAttribute \"button-text\"\n        |> Markdown.Html.withAttribute \"color\"\n\n","type":"String.String -> Markdown.Html.Renderer (String.String -> view) -> Markdown.Html.Renderer view"},{"name":"withOptionalAttribute","comment":" Same as `withAttribute`, but the Renderer won't fail if the attribute is missing.\nInstead, it just returns `Nothing` for missing attributes.\n\n    import Html\n    import Html.Attributes as Attr\n    import Markdown.Html\n\n    Markdown.Html.tag \"bio\"\n        (\\name twitter github children ->\n            bioView name twitter github children\n        )\n\n","type":"String.String -> Markdown.Html.Renderer (Maybe.Maybe String.String -> view) -> Markdown.Html.Renderer view"}],"binops":[]},{"name":"Markdown.Parser","comment":"\n\n@docs Renderer, defaultHtmlRenderer, deadEndToString, parse, render\n\n","unions":[],"aliases":[{"name":"Renderer","comment":" A record with functions that define how to render all possible markdown blocks.\nThese renderers are composed together to give you the final rendered output.\n\nYou could render to any type you want. Here are some useful things you might render to:\n\n  - `Html` (using the `defaultHtmlRenderer` provided by this module)\n  - Custom `Html`\n  - `Element`s from [`mdgriffith/elm-ui`](https://package.elm-lang.org/packages/mdgriffith/elm-ui/latest/)\n  - Types from other custom HTML replacement libraries, like [`rtfeldman/elm-css`](https://package.elm-lang.org/packages/rtfeldman/elm-css/latest/) or [`tesk9/accessible-html`](https://package.elm-lang.org/packages/tesk9/accessible-html/latest/)\n  - Raw `String`s with [ANSI color codes](http://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html) for setting rich colors in terminal (CLI) output\n  - Plain text with any formatting stripped away (maybe for a String search feature)\n\n","args":["view"],"type":"{ heading : { level : Basics.Int, rawText : String.String, children : List.List view } -> view, raw : List.List view -> view, html : Markdown.Html.Renderer (List.List view -> view), plain : String.String -> view, code : String.String -> view, bold : String.String -> view, italic : String.String -> view, link : { title : Maybe.Maybe String.String, destination : String.String } -> List.List view -> Result.Result String.String view, image : { src : String.String } -> String.String -> Result.Result String.String view, unorderedList : List.List (List.List view) -> view, orderedList : Basics.Int -> List.List (List.List view) -> view, codeBlock : { body : String.String, language : Maybe.Maybe String.String } -> view, thematicBreak : view }"}],"values":[{"name":"deadEndToString","comment":" Turn a parsing problem into the default String representation.\n","type":"Parser.Advanced.DeadEnd String.String Parser.Problem -> String.String"},{"name":"defaultHtmlRenderer","comment":" This renders `Html` in an attempt to be as close as possible to\nthe HTML output in <https://github.github.com/gfm/>.\n","type":"Markdown.Parser.Renderer (Html.Html msg)"},{"name":"parse","comment":" Try parsing a markdown String into `Markdown.Block.Block`s.\n\nOften you'll want to render these `Block`s directly:\n\n    render renderer markdown =\n        markdown\n            |> Markdown.parse\n            |> Result.mapError deadEndsToString\n            |> Result.andThen (\\ast -> Markdown.render renderer ast)\n\n    deadEndsToString deadEnds =\n        deadEnds\n            |> List.map deadEndToString\n            |> String.join \"\\n\"\n\nBut you can also do a lot with the `Block`s before passing them through:\n\n  - Transform the `Block`s ([example: make each heading one level deeper](TODO))\n  - Use the blocks to gather metadata about the markdown document ([example: building a table of contents from `Block`s](TODO))\n\n","type":"String.String -> Result.Result (List.List (Parser.Advanced.DeadEnd String.String Parser.Problem)) (List.List Markdown.Block.Block)"},{"name":"render","comment":" Apply a `Markdown.Parser.Renderer` to turn parsed `Block`s into your rendered\nmarkdown view.\n","type":"Markdown.Parser.Renderer view -> List.List Markdown.Block.Block -> Result.Result String.String (List.List view)"}],"binops":[]}]