Skip to content

Commit dd0aca9

Browse files
anselmbradfordtmcw
authored andcommitted
Prevent double call to require when theme is set + jsdoc fixes (#411)
- Updates html.js to not double call require when theme is set. - Normalizes jsdoc comments.
1 parent 3da1ff6 commit dd0aca9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/output/html.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@ var path = require('path');
55
/**
66
* Formats documentation as HTML.
77
*
8-
* @param {Array<Object>} comments parsed comments
8+
* @param {Array<Object>} comments Parsed comments.
99
* @param {Object} options Options that can customize the output
1010
* @param {string} [options.theme='documentation-theme-default'] Name of a module used for an HTML theme.
11-
* @param {Function} callback called with array of results as vinyl-fs objects
12-
* @returns {undefined} calls callback
11+
* @param {Function} callback Called with array of results as vinyl-fs objects.
12+
* @returns {undefined} Calls callback.
1313
* @name html
1414
*/
1515
module.exports = function makeHTML(comments, options, callback) {
1616
options = options || {};
17-
var theme = require('documentation-theme-default');
17+
var theme;
1818
if (options.theme) {
1919
theme = require(path.resolve(process.cwd(), options.theme));
20+
} else {
21+
theme = require('documentation-theme-default');
2022
}
2123
theme(comments, options, callback);
2224
};

0 commit comments

Comments
 (0)