Skip to content

Commit 04355a8

Browse files
committed
More internal documentation
1 parent 21371e7 commit 04355a8

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-0
lines changed

lib/commands/build.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ var streamArray = require('stream-array'),
1010
module.exports = build;
1111
module.exports.description = 'build documentation';
1212

13+
/**
14+
* Add yargs parsing for the build command
15+
* @param {Object} yargs module instance
16+
* @returns {Object} yargs with options
17+
* @private
18+
*/
1319
module.exports.parseArgs = function (yargs) {
1420
return sharedOptions.sharedOutputOptions(
1521
sharedOptions.sharedInputOptions(yargs))

lib/commands/lint.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,28 @@
44

55
module.exports = lint;
66
module.exports.description = 'check for common style and uniformity mistakes';
7+
8+
/**
9+
* Add yargs parsing for the lint command
10+
* @param {Object} yargs module instance
11+
* @returns {Object} yargs with options
12+
* @private
13+
*/
714
module.exports.parseArgs = function (yargs) {
815
return yargs
916
.example('documentation lint project.js', 'check documentation style')
1017
.help('help');
1118
};
1219

20+
/**
21+
* Wrap around the documentation.lint method and add the additional
22+
* behavior of printing to stdout and setting an exit status.
23+
*
24+
* @param {Object} documentation self-module instance
25+
* @param {Object} parsedArgs cli arguments
26+
* @returns {undefined} has side-effects
27+
* @private
28+
*/
1329
function lint(documentation, parsedArgs) {
1430
documentation.lint(parsedArgs.inputs, parsedArgs.options, function (err, lintOutput) {
1531
if (err) {

lib/commands/readme.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ var build = require('./build');
99

1010
module.exports = readme;
1111
module.exports.description = 'inject documentation into your README.md';
12+
/**
13+
* Add yargs parsing for the readme command
14+
* @param {Object} yargs module instance
15+
* @returns {Object} yargs with options
16+
* @private
17+
*/
1218
module.exports.parseArgs = function (yargs) {
1319
return yargs.usage('Usage: documentation readme [--readme-file=README.md] --section "API"' +
1420
' [--compare-only] [other documentationjs options]')

lib/commands/serve.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ var build = require('./build');
88

99
module.exports = serve;
1010
module.exports.description = 'generate, update, and display HTML documentation';
11+
/**
12+
* Add yargs parsing for the serve command
13+
* @param {Object} yargs module instance
14+
* @returns {Object} yargs with options
15+
* @private
16+
*/
1117
module.exports.parseArgs = function (yargs) {
1218
return sharedOptions.sharedOutputOptions(
1319
sharedOptions.sharedInputOptions(yargs));

lib/server.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ Server.prototype.setFiles = function (files) {
3333
return this;
3434
};
3535

36+
/**
37+
* Internal handler for server requests. The server serves
38+
* very few types of things: html, images, and so on, and it
39+
* only handles GET requests.
40+
*
41+
* @param {http.Request} request content wanted
42+
* @param {http.Response} response content returned
43+
* @returns {undefined} nothing
44+
* @private
45+
*/
3646
Server.prototype.handler = function (request, response) {
3747
var path = request.url.substring(1);
3848
if (path === '') {

0 commit comments

Comments
 (0)