Metalsmith - mithril
Metalsmith plugin that creates html out of mithril.js code.
Installation
npm install metalsmith-mithril --save
Usage
With source files
var Metalsmith = ;var mithril = ;
example.m.js
var m = ; moduleexports = metadata: title: 'Page title' { // call callback when controller is done // if callback is ommitted in arguments, controller is supposed to be sync ; } { return ; };
With layouts
var Metalsmith = ;var mithril = ;
layouts/example.m.js
var m = ; moduleexports = { // call callback when controller is done // if callback is ommitted in arguments, controller is supposed to be sync ; } { return ; };
example.html
---title: Example---This is the content.
Results in:
ExampleThis is the content.
Development
To run the tests do:
npm test