mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-25 14:26:29 +00:00
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.
This commit is contained in:
parent
3da1ff6dd0
commit
dd0aca93e6
@ -5,18 +5,20 @@ var path = require('path');
|
||||
/**
|
||||
* Formats documentation as HTML.
|
||||
*
|
||||
* @param {Array<Object>} comments parsed comments
|
||||
* @param {Array<Object>} comments Parsed comments.
|
||||
* @param {Object} options Options that can customize the output
|
||||
* @param {string} [options.theme='documentation-theme-default'] Name of a module used for an HTML theme.
|
||||
* @param {Function} callback called with array of results as vinyl-fs objects
|
||||
* @returns {undefined} calls callback
|
||||
* @param {Function} callback Called with array of results as vinyl-fs objects.
|
||||
* @returns {undefined} Calls callback.
|
||||
* @name html
|
||||
*/
|
||||
module.exports = function makeHTML(comments, options, callback) {
|
||||
options = options || {};
|
||||
var theme = require('documentation-theme-default');
|
||||
var theme;
|
||||
if (options.theme) {
|
||||
theme = require(path.resolve(process.cwd(), options.theme));
|
||||
} else {
|
||||
theme = require('documentation-theme-default');
|
||||
}
|
||||
theme(comments, options, callback);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user