Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 1002 Bytes

README.md

File metadata and controls

37 lines (23 loc) · 1002 Bytes

Introduction

The mdtodom.js script renders a commonmark.js AST directly into DOM on modern web browsers to make a webpage from a Markdown content.

(License)

Usage

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);

See also

The project home.

Informational references

The Fetch standard by WHATWG.

The Fetch API documentation on MDN.