A plugin to compile Markdown to Javascript for the Component builder.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
.gitignore
History.md
Makefile
README.md
index.js
package.json

README.md

component-markdown

A plugin to compile Markdown to Javascript for the component builder.

Install

$ npm install component-markdown

Usage

Add your Markdown files to the templates array in your component.json:

{
  "templates": [
    "readme.md",
    "history.markdown"
  ]
}

Use the plugin during your build process:

var fs = require('fs')
  , Builder = require('component-builder')
  , markdown = require('component-markdown');

var builder = new Builder(__dirname);

builder.use(markdown);

builder.build(function(err, res){
  if (err) throw err;
  fs.writeFileSync('build/build.js', res.require + res.js);
  if (res.css) fs.writeFileSync('build/build.css', res.css);
});

And then require the files in your Javascript:

var readme = require('readme.md')
  , history = require('history.markdown');