md-mini.js mdm

mdm · markdown mini

Markdown to HTML,
in one small file.

A tiny, zero-dependency Markdown→HTML renderer in a single ES module. Pure string → string — no DOM, so it behaves identically in Node and the browser. Everything below the fold on this page was rendered by it, live, from this project's own README.

or the full bundle — md-mini.tgz md-mini.zip
$ curl -O https://smisco.biz/mdm/md-mini.js
zero dependencies ~230 lines one ES module MIT
// drop the one file in, import it, call it
import { renderMarkdown } from './md-mini.js';

const html = renderMarkdown('# Hello\n\n**Markdown**, rendered.');
// -> an HTML string, ready to inject
document.querySelector('#doc').innerHTML = html;

view source

The input, the renderer, the harness.

Everything this page runs on, in the open: the README's raw Markdown, the renderer (md-mini.js) itself, and the small HTML page that fetches it and calls renderMarkdown. The rendered result is just below.

Loading…

rendered live · from README.md

See it work.

The document below is this project's README.md, fetched over the network and turned into the HTML you are reading by md-mini.js — in your browser, with no build step and nothing else loaded.

Loading the documentation…