Skip to content

Commit

Permalink
feat(build): load passed in config option
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Dec 5, 2016
1 parent 363a108 commit eda4469
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ var fs = require('fs'),
formatLint = require('./lib/lint').formatLint,
garbageCollect = require('./lib/garbage_collect'),
lintComments = require('./lib/lint').lintComments,
markdownAST = require('./lib/output/markdown_ast');
markdownAST = require('./lib/output/markdown_ast'),
loadConfig = require('./lib/load_config');

/**
* Build a pipeline of comment handlers.
Expand Down Expand Up @@ -137,6 +138,7 @@ function build(indexes, options, callback) {
*
* @param {Array<string>} indexes files to process
* @param {Object} options options
* @param {string} config path to configuration file to load
* @param {Array<string>} options.external a string regex / glob match pattern
* that defines what external modules will be whitelisted and included in the
* generated documentation.
Expand Down Expand Up @@ -172,6 +174,10 @@ function buildSync(indexes, options) {
options = options || {};
options.hljs = options.hljs || {};

if (typeof options.config === 'string') {
Object.assign(options, loadConfig(options.config))
}

if (!options.access) {
options.access = ['public', 'undefined', 'protected'];
}
Expand Down

0 comments on commit eda4469

Please sign in to comment.