jox

JavaScript documentation generator

run(source, dest, templatePath)

Run jox via its Node.js-API. Example:

#!/usr/bin/env node
var jox = require('jox');
jox.run(['src/file.js'], 'doc/index.html', 'template.ejs');
Array source
JavaScript files to parse.
String dest
Destination HTML file. Example: "index.html".
String templatePath
Template file to use. Example: "template.ejs"

getCommentsByTag(comments, filter)

Filters comments. Only comments with at least one tag matching the filter will be returned.

var functionComments = getCommentsByTag(comments,{ type: "function" });

Note that this function only is available in the templating engine.

Array comments
The comments to filter.
Object filter
A filter object. All key/value pairs in it will be used to match against tags.

filterTags(tags, filter)

Filters tags and returns the filtered array. Only tags matching the filter will be included in the result.

Example:

var paramTags = filterTags(comments[0].tags,{ type : "param" });

Note that this function only is available in the templating engine.

Array tags
An array of tags to filter.
Object filter
A filter to apply. All key/value pairs must match against a tag for it to be accepted.