nanomd

1.0.5 • Public • Published

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

Package Sidebar

Install

npm i nanomd

Weekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

6.92 kB

Total Files

5

Last publish

Collaborators

  • mantoni