jsdoc/templates
Kevin Locke 67d3693214 Create silent template
This commit creates a template named `silent` which outputs nothing at
all.  As discussed in the `README.md`, this can be useful when running
JSDoc as a linter to check for syntax errors or unknown tags.  It may
also be useful for testing or benchmarking.

The same effect can be achieved using the haruki template and
redirecting the output to /dev/null, but this has a few downsides:

* It is non-obvious.
* It is difficult to do in scripts which must run in bash and cmd.exe
  (like npm scripts).
* It is slower due to the unnecessary formatting work and output
  syscalls.

This template could be distributed as a third-party template, but given
the tiny code size, broad applicability, and potential usefulness for
tests, it makes sense to include it officially.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2016-02-24 14:28:53 -08:00
..
2016-02-24 14:28:53 -08:00
2014-03-04 13:47:57 -08:00

To create or use your own template:

  1. Create a folder with the same name as your template (for example, mycooltemplate).
  2. Within the template folder, create a file named publish.js. This file must be a CommonJS module that exports a method named publish.

For example:

/** @module publish */

/**
 * Generate documentation output.
 *
 * @param {TAFFY} data - A TaffyDB collection representing
 *                       all the symbols documented in your code.
 * @param {object} opts - An object with options information.
 */
exports.publish = function(data, opts) {
    // do stuff here to generate your output files
};

To invoke JSDoc 3 with your own template, use the -t command line option, and specify the path to your template folder:

./jsdoc mycode.js -t /path/to/mycooltemplate