jxxcarlson/elm-markdown/9.4.0

NOTE: the latest version is 10.1.0

Markdown.Render

For simple applications, the function toHtml will be enough. The other functions are mostly for building apps, e.g., editors, in which the source text changes a lot. The best guide to using the code are the examples. See the folder examples and editors.

Types

= Simple (Html MarkdownMsg)
| Composite DocumentParts

the type of output

= IDClicked String

Use Html MarkdownMsg so that user clicks on elements in the rendered text can be detected.

type alias DocumentParts =
{ title : Html MarkdownMsg
, toc : Html MarkdownMsg
, document : Html MarkdownMsg
}

The parts of a composite document

Rendering

toHtml : MarkdownOption -> String -> Html MarkdownMsg

Render source test given an a Markdown flavor

withOptions : MarkdownOption -> OutputOption -> Id -> Int -> String -> MarkdownOutput

Render content with Markdown and output options, given a selected Id and a version

Rendering from AST

fromAST : Id -> Tree MDBlockWithId -> Html MarkdownMsg

Render to Html from a parse tree

Getters

Get parts of a document from a MarkdownOutput value.

document content

Table of contents

Utility

Count the number of display math element blocks in the parse tree