Origami.

mdHtml(markdown)

Treats the text of its argument as markdown (GitHub-flavored) and translates it to HTML.

Any front matter in the markdown will be preserved at the top of the HTML output.

$ ori "Origami.mdHtml('# Hello, world')"
<h1 id="hello-world">Hello, world</h1>

See also Origami.mdOutline for extracting the outline structure of a markdown document.

Supported markdown #

The Origami.mdHtml command supports Github-Flavored Markdown, a strict superset of CommonMark that includes:

  • Automatic translation of links like https://example.com
  • Strikethrough: ~mistake~ becomes mistake
  • Tables
  • Task lists
  • Syntax highlighting of programming code in code blocks
  • Creation of heading IDs: # Hello, world! generates: <h1 id="hello-world">Hello, world!</h1>

Additionally, Origami.mdHtml adds typgraphic support for:

  • Smart quotes: "Yes" and 'No' become “Yes” and ‘No’.
  • En-dashes: -- becomes –
  • Em-dashes: --- becomes —
  • Ellipsis: ... becomes …