The mdtodom.js
script renders a commonmark.js AST directly into DOM on
modern web browsers to make a webpage from a Markdown content.
The basic usage of the script is shown below:
import {DOMRenderer} from "./mdtodom.js";
// Assuming commonmark.js has been loaded.
let parser = new window.commonmark.Parser();
let renderer = new DOMRenderer(document);
let child = rendereer.render(parser.parse("*something* in Markdown"));
let container = document.getElementById("container");
container.appendChild(child);
The project home.
The Fetch standard by WHATWG.
The Fetch API documentation on MDN.