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
.
the type of output
Use Html MarkdownMsg
so that user clicks on elements in the rendered text can be detected.
{ title : Html MarkdownMsg
, toc : Html MarkdownMsg
, document : Html MarkdownMsg
}
The parts of a composite document
toHtml : Markdown.Option.MarkdownOption -> String -> Html MarkdownMsg
Render source test given an a Markdown flavor
toHtml_ : Markdown.Option.MarkdownOption -> String -> List (Html MarkdownMsg)
Like toHtml
, but produces a List (Html MarkdownMsg)
value.
withOptions : Markdown.Option.MarkdownOption -> Markdown.Option.OutputOption -> Markdown.Parse.Id -> Basics.Int -> String -> MarkdownOutput
Render content with Markdown and output options, given a selected Id and a version
fromAST : Markdown.Parse.Id -> Tree Markdown.Parse.MDBlockWithId -> Html MarkdownMsg
Render to Html from a parse tree
fromASTWithOptions : Markdown.Option.OutputOption -> Markdown.Parse.Id -> Tree Markdown.Parse.MDBlockWithId -> MarkdownOutput
Render from an AST
Get parts of a document from a MarkdownOutput value.
document : MarkdownOutput -> Html MarkdownMsg
document content
title : MarkdownOutput -> Html MarkdownMsg
toc : MarkdownOutput -> Html MarkdownMsg
Table of contents
numberOfMathElements : Tree Markdown.Parse.MDBlockWithId -> Basics.Int
Count the number of display math element blocks in the parse tree