Official documentation of docgenerator

Before reading this documentation, I sincerely suggest that you read the README before that if you haven't done so.

It's not very long, but it's worth it.

1. Installation

docgenerator requires a dependency before anything else:

Once you've installed it, you can:

npm install docgenerator

This will create a node_modules folder, within which the docgenerator module will live.

2. API Reference

2.1. Introduction

docgenerator provides two methods:

Basically, you need to provide docgenerator enough properties for it to generate your documentation.

This is a typical example of what a generator should look like:

var generator = require( 'docgenerator' );

// Create the array of original files
var files = [
    'original/1. Chapter One.md',
    'original/2. Chapter Two.md',
    'original/3. Chapter Three.md'
];

// Now that we have the files, we can set the options
// and generate the documentation.
generator
    .set( 'option', 'value' )
    // The "files" options expects an array of files.
    // Good! We just built this array before :-)
    .set( 'files', files )

    // Run!
    .generate();

2.2. Options

Here is the list of options supported and their type expected:

3. Themes

docgenerator provides some themes by default.

These themes are:

However, it also provides you a way to define your own themes.

When setting the theme, use a string like custom:path/to/theme. Example:

generator
    .set( 'theme', 'custom:themes/mytheme' )
    .generate();

This code will look in the themes/mytheme folder for CSS and JS files and add them to the generated documentation. For convenience, these files are sorted with the javascript sort() method.