0.2.1 • Published 8 years ago

broccoli-asciidoc v0.2.1

Weekly downloads
10
License
Apache-2.0
Repository
github
Last release
8 years ago

broccoli-asciidoc

An AsciiDoc filter for Broccoli using asciidoctor.js. It converts AsciiDoc files (*.asciidoc, *.adoc or *.asc) to HTML as part of a Broccoli build.

Since asciidoctor.js is a pure JavaScript implementation of AsciiDoc, no external dependencies are necessary.

Installation

Install with:

npm install --save-dev broccoli-asciidoc

Usage

Basic usage in Brocfile.js:

var asciidocToHtml = require('broccoli-asciidoc');
var htmlFiles = asciidocToHtml(
  'path/to/asciidoc/files',
  { /* asciidoctor.js options */ });

The 2nd argument may be omitted if not specifying asciidoctor.js options.

Example usage with Ember CLI in ember-cli-build.js:

var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var Funnel = require('broccoli-funnel');
var asciidocToHtml = require('broccoli-asciidoc');

module.exports = function(defaults) {
  var app = new EmberApp(defaults, {...});
  var asciidocHtmlAssets = Funnel(
    asciidocToHtml('asciidoc'),
    {
      destDir: 'assets'
    });
  ...
  return app.toTree([asciidocHtmlAssets]);
};

The above snippet will convert all AsciiDoc input files under the asciidoc directory in the project root and place output files under dist/assets.

0.2.1

8 years ago

0.2.0

8 years ago

0.1.3

8 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.1

9 years ago