Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

component-markdown

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

component-markdown

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

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

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');

Keywords

component

FAQs

Package last updated on 16 Jul 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts