jxxcarlson/xmarkdown-compiler/2.2.5

NOTE: the latest version is 2.2.6

HTML.Export

Export a parsed XMarkdown document as a complete web page.

The page displays in any browser; math is typeset by KaTeX, loaded from a CDN. An "Export HTML" button does

source
    |> XMarkdown.API.parse
    |> HTML.Export.toTextHtml WithTOC WithSectionNumbers

and saves the resulting string. Every element carries an xm-* class, so the page can be restyled with CSS.

type TOC
= WithTOC
| WithoutTOC

Whether the page has a table of contents, after the title.

= WithSectionNumbers
| WithoutSectionNumbers

Whether section headings (and table-of-contents entries) are numbered: 1, 1.1, 2, …

toTextHtml : TOC -> SectionNumbers -> AST -> String

The complete page, from <!doctype html> to </html>.