Nightly Procrastination Machine
Miss any of our Open RFC calls?Watch the recordings here! »

commonmark-to-dom

4.0.0 • Public • Published

Introduction

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

(License)

Usage

import { render } from "./mdtodom.js";
 
// Assuming commonmark.js has been loaded.
let parser = new commonmark.Parser();
let child = render(document, parser.parse("*something*"));
 
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.

Install

npm i commonmark-to-dom

DownloadsWeekly Downloads

13

Version

4.0.0

License

MIT

Unpacked Size

39.4 kB

Total Files

11

Last publish

Collaborators

  • avatar