Typedoc in Angular2-webpack-starter

杨旭 bio photo By 杨旭

Typedoc

Documentation generator for TypeScript projects

Install

$ npm install -g typedoc
$ typedoc

Usage

$ typedoc --out path/to/documentation/ path/to/typescript/project/

Typedoc in Angular2-webpack-starter

typedoc.json at root of the project

{
  "mode": "modules",
  "out": "doc",
  "theme": "default",
  "ignoreCompilerErrors": "true",
  "experimentalDecorators": "true",
  "emitDecoratorMetadata": "true",
  "target": "ES5",
  "moduleResolution": "node",
  "preserveConstEnums": "true",
  "stripInternal": "true",
  "suppressExcessPropertyErrors": "true",
  "suppressImplicitAnyIndexErrors": "true",
  "module": "commonjs"
}
  • generate document to doc directory

npm script in package.json

"docs": "npm run typedoc -- --options typedoc.json --exclude '**/*.spec.ts' ./src/",
  • run typedoc with typedoc.json as options
  • exclude test files
  • generate documents from src folder

    The result document looks like:

The Doc Comments