ESDoc

ESDoc is a good documentation generator for JavaScript.

Features

  • Generates good documentation.
  • Measures documentation coverage.
  • Integrate test codes into documentation.
  • Integrate manual into documentation.
  • Parse ECMAScript proposals.
  • Add custom features by plugin architecture
  • ESDoc Hosting Service

Users

And more.

Quick Start

# move to a your project directory
cd your-project/

# install ESDoc and standard plugin
npm install esdoc esdoc-standard-plugin

# write a configuration file.
echo '{
  "source": "./src",
  "destination": "./docs",
  "plugins": [{"name": "esdoc-standard-plugin"}]
}' > .esdoc.json

# run ESDoc
./node_modules/.bin/esdoc

# see a documentation
open ./docs/index.html

License

MIT

Author

Ryo Maruyama@h13i32maru

Usage

Installation

Install ESDoc and standard-plugin from npm.

cd your-project/
npm install --save-dev esdoc esdoc-standard-plugin
./node_modules/.bin/esdoc -h

Configuration

The minimum configuration is the following JSON. All configurations are here.

.esdoc.json

{
  "source": "./src",
  "destination": "./docs",
  "plugins": [
    {"name": "esdoc-standard-plugin"}
  ]
}

ESDoc automatically finds the configuration file path by the order, if you don't specify -c esdoc.json.

  1. .esdoc.json in the current directory
  2. .esdoc.js in the current directory
  3. esdoc property in package.json

Writing Tags

ESDoc supports some documentation tags(aka. jsdoc tags). All tags are here.

/**
 * this is MyClass.
 */
export default class MyClass {
  /**
   * @param {number} a - this is a value.
   * @param {number} b - this is a value.
   * @return {number} result of the sum value.
   */
  sum(a, b){
    return a + b;
  }
}

And run ESDoc.

./node_modules/.bin/esdoc
open ./docs/index.html

Features

ESDoc provides a lot of features.

Core Features (via body)