Tom Macwright ed5c2a04a4 feat(lint): Identify explicit tags that don't match inference in lint stage
This will flag cases where people explicitly document things in JSDoc that don't reflect the code
reality - in many cases, misnamed parameter names in documentation tags.

Fixes https://github.com/documentationjs/documentation/issues/575
2017-05-01 14:26:00 -04:00

38 lines
1.1 KiB
JavaScript

'use strict';
/* @flow */
var path = require('path');
var mergeConfig = require('../merge_config');
/**
* Formats documentation as HTML.
*
* @param comments parsed comments
* @param {Object} config Options that can customize the output
* @param {string} [config.theme='default_theme'] Name of a module used for an HTML theme.
* @returns {Promise<Array<Object>>} Promise with results
* @name formats.html
* @public
* @example
* var documentation = require('documentation');
* var streamArray = require('stream-array');
* var vfs = require('vinyl-fs');
*
* documentation.build(['index.js'])
* .then(documentation.formats.html)
* .then(output => {
* streamArray(output).pipe(vfs.dest('./output-directory'));
* });
*/
function html(comments /*: Array<Comment>*/, config /*: DocumentationConfig*/) {
return mergeConfig(config).then(config => {
var themePath = '../../default_theme/';
if (config.theme) {
themePath = path.resolve(process.cwd(), config.theme);
}
return require(themePath)(comments, config);
});
}
module.exports = html;