A tiny browserify transform to require markdown files compiled with nanohtml. Works great with choo™.
- Transparently use any markdown with marked in html templates.
- Pre-compile markdown to avoid bundling and running a markdown parser.
- Designed for choo / nanohtml.
❯ npm install nanomd
const html = require('nanohtml');
const hello = require('./hello.md');
const el = html`
<body>
<h1>Hello markdown</h1>
${hello()}
</body>
`;
document.body.appendChild(el);
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.
MIT