0.0.1 • Published 10 years ago

broccoli-marked v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

broccoli-marked

Build Status

A Markdown filter for Broccoli using Christopher Jeffrey's fast Markdown parser and compiler Marked. This plugin is too built for speed through doing the parsing and compiling asynchronously. You can ask for code highlighting too using highlight.js (see Code Highlighting below).

Installation

npm install --save-dev broccoli-marked

Usage

var markdownToHtml = require('broccoli-marked');
htmls = markdownToHtml('path/to/markdown-files');

Code Highlighting

To use highlight.js:

npm install --save-dev highlight.js

and in Brocfile:

var markdownToHtml = require('broccoli-marked');
var highlight = require('highlight.js');

var htmls = markdownToHtml('path/to/markdown-files', {
    highlight: function (code) {
        return highlight.highlightAuto(code).value;
    }
});

You will need to include one of highlight.js's vast choice of styles including ones that resemble those at GitHub, GoogleCode and many more. For example:

var highlightCss = pickFiles('node_modules/highlight.js', {
  srcDir: 'styles',
  files: ['googlecode.css'],
  destDir: '.'
});

or just manually include the .css in the .html.