0.1.1-beta • Published 8 years ago

documentation-loader v0.1.1-beta

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

documentation-loader

Build Status npm version

Webpack loader for documentation

Install

$ npm install documentation-loader --save-dev

Usage

Documentation: using loaders

Within your webpack configuration, you'll need to add the documentation-loader to the list of modules:

module.exports = {
  // ...
  module: {
      postLoaders: [
          {
              test: [/\.js$/],
              exclude: /(node_modules|bower_components)/,
              loader: 'documentation'
          }
      ]
  }
  // ...
}

Configuration

module.exports = {
  // ...
  documentation: {
      // Output location
      // Default: './documentation'
      output: String,

      // Infer links to github in documentation
      // Default: false
      github: Boolean,

      // Output format
      // Default: 'json'
      format: String,

      // Configuration file
      // Default: null
      config: String,

      // Specify a theme
      // Default: null
      theme: String,

      // Shallow mode turns off dependency resolution, only processing the specified files
      // Default: false
      shallow: Boolean,

      // File/files to parse
      // Default: Webpack input
      entry: String,
  },
  // ...
}

Example webpack.config

module.exports = {
    entry: {
        app: './app.js'
    },
    output: {
        path: './public',
    },
    module: {
        preLoaders: [
            {
                test: [/\.js$/],
                exclude: /(node_modules|bower_components)/,
                loader: 'eslint'
            }
        ],
        loaders: [
            {
                test: [/\.js$/],
                exclude: /(node_modules|bower_components)/,
                loader: 'babel'
            }
        ],
        postLoaders: [
            {
                test: [/\.js$/],
                exclude: /(node_modules|bower_components)/,
                loader: 'documentation'
            }
        ]
    }
    documentation: {
        entry: './assets/js/*.js .assets/js/**/*.js',
        github: true,
        format: 'html',
        output: './documentation/js'
    }
};
0.1.1-beta

8 years ago

0.1.0-beta

8 years ago

0.0.1-alpha

8 years ago