Skip to content

Rincewind3d/asciidoctor-loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asciidoctor loader for webpack

Installation

npm install asciidoctor-loader --save-dev

Usage

Documentation: Using loaders

var readme = require('html!asciidoctor!./README.adoc');
// => returns parsed file content

Config

Config examples for loading asciidoctor files.

Webpack 1

module.exports = {
  module: {
    loaders: [
      { test: /\.adoc$/, loader: "html!asciidoctor" }
    ]
  }
};

Webpack 2

    rules: [
        {
            test: /\.adoc/,
            use: [
                {
                    loader: "html-loader",
                     options: {
                        interpolate: 'require'
                     }
                },
                {
                    loader: "asciidoctor-loader",
                    options: {
                        attributes: 'showtitle'
                    }
                }
            ]

        }
    ]

The attribute showtitle allows h1 headers to be rendered.

Use the html-loader option interpolate to enable the asciidoc include::[] syntax.

Files loaded through include::[] will be affected from other webpack loaders.

License

MIT (http://www.opensource.org/licenses/mit-license.php)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 78.0%
  • HTML 22.0%