This renders Html in an attempt to be as close as possible to
the HTML output in https://github.github.com/gfm/.
Turn a parsing problem into the default String representation.
Try parsing a markdown String into Markdown.Block.Blocks.
Often you'll want to render these Blocks directly:
render renderer markdown =
markdown
|> Markdown.parse
|> Result.mapError deadEndsToString
|> Result.andThen (\ast -> Markdown.render renderer ast)
deadEndsToString deadEnds =
deadEnds
|> List.map deadEndToString
|> String.join "\n"But you can also do a lot with the Blocks before passing them through:
Blocks (example: make each heading one level deeper)Blocks)
A record with functions that define how to render all possible markdown blocks. These renderers are composed together to give you the final rendered output.
You could render to any type you want. Here are some useful things you might render to:
Html(using thedefaultHtmlRendererprovided by this module)HtmlElements frommdgriffith/elm-uirtfeldman/elm-cssortesk9/accessible-htmlStrings with ANSI color codes for setting rich colors in terminal (CLI) output