Skip to content

A tiny browserify transform to require markdown files compiled with nanohtml

License

Notifications You must be signed in to change notification settings

mantoni/nanomd.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A tiny browserify transform to require markdown files compiled with nanohtml

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published