mork

Mörk is a Markdown parser for Gleam that should work in both Erlang and Javascript contexts.

The goal is 100% spec compliance with Commonmark, as well as supporting GFM (Github Flavored Markdown) extensions like footnotes.

Status right now is that it is entirely unusable and experimental. To see what the current state of the parser is, see the test suite.

Values

pub fn parse(md: String) -> document.Document

Parse a string containing Markdown into a Document structure. Document can be turned into HTML using the to_html function.

import mork

pub fn main() {
  let md = "# hello world\n"
  let html = md
    |> mork.parse
    |> mork.to_html
  io.print(html)
}
pub fn to_html(doc: document.Document) -> String

Convert a Document structure to HTML.

Search Document