Skip to content

How to: Auto Code Documentation

Srishti Hunjan edited this page Nov 28, 2017 · 1 revision

Front-end (Angular)

For the front-end, we are using the compodoc npm package.

To install:

  $ npm install -g @compodoc/compodoc

Documentation is generated in default documentation output folder, and a local HTTP server is available at http://localhost:8080.

  $ compodoc -p tsconfig.json -s

Back-end (Node.js)

Note: This section is in development currently.

To document REST requests we used the api-doc-generator npm package. It is a simple wrapper for generating REST API documentation based on Dox parser and Milligram CSS framework. It makes our JSDoc comments as human-friendly as possible. It provides a simple syntax and displays colorized documentation.

Install api-doc-generator globally:

  npm install -g api-doc-generator

Usage:

  api-doc-generator [options]
 
  Options:
 
    -h, --help                     output usage information
    -t, --title                    provide the document title
    -i, --input                    provide input file
    -o, --output                   provide output directory

Example:

  $ api-doc-generator --title My API Docs --input routes.js --output docs

Generator will create docs directory and put into the following files:

  • index.html
  • api-doc-generator.min.css
  • api-doc-generator.min.js

Authors:

Clone this wiki locally