Skip to content

Latest commit

 

History

History
68 lines (49 loc) · 1.29 KB

README.md

File metadata and controls

68 lines (49 loc) · 1.29 KB

nanomd

Build Status SemVer License

A tiny browserify transform to require markdown files compiled with nanohtml. Works great with choo™.

Why?

  • Transparently use any markdown with marked in html templates.
  • Pre-compile markdown to avoid bundling and running a markdown parser.
  • Designed for choo / nanohtml.

Install

❯ npm install nanomd

Usage

const html = require('nanohtml');
const hello = require('./hello.md');

const el = html`
  <body>
    <h1>Hello markdown</h1>
    ${hello()}
  </body>
`;

document.body.appendChild(el);

Compile with browserify

From the command line:

browserify -t nanomd -t nanohtml index.js > bundle.js

In your package.json:

"browserify": {
  "transform": [
    "nanomd",
    "nanohtml"
  ]
}

Make sure to run nanomd before the nanohtml transform.

License

MIT