diff --git a/docs/NODE_API.md b/docs/NODE_API.md index 6a1cbe0ad..26a85d7a0 100644 --- a/docs/NODE_API.md +++ b/docs/NODE_API.md @@ -105,7 +105,7 @@ Formats documentation as HTML. **Parameters** - `comments` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Comment](https://developer.mozilla.org/en-US/docs/Web/API/Comment/Comment)>** parsed comments -- `config` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output +- `config` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output (optional, default `{}`) - `config.theme` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of a module used for an HTML theme. (optional, default `'default_theme'`) **Examples** @@ -132,7 +132,7 @@ Formats documentation as **Parameters** - `comments` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** parsed comments -- `args` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output +- `args` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output (optional, default `{}`) **Examples** diff --git a/src/output/html.js b/src/output/html.js index 16a5f6f81..d7a4e0614 100644 --- a/src/output/html.js +++ b/src/output/html.js @@ -23,8 +23,8 @@ var mergeConfig = require('../merge_config'); * streamArray(output).pipe(vfs.dest('./output-directory')); * }); */ -function html(comments: Array, config: DocumentationConfig) { - return mergeConfig(config).then(config => { +function html(comments: Array, config: Object = {}) { + return mergeConfig(config).then((config: DocumentationConfig) => { var themePath = '../default_theme/'; if (config.theme) { themePath = path.resolve(process.cwd(), config.theme); diff --git a/src/output/markdown.js b/src/output/markdown.js index 29a3127e2..f496be07f 100644 --- a/src/output/markdown.js +++ b/src/output/markdown.js @@ -1,6 +1,7 @@ /* @flow */ -var remark = require('remark'), markdownAST = require('./markdown_ast'); +var remark = require('remark'), + markdownAST = require('./markdown_ast'); /** * Formats documentation as @@ -22,7 +23,10 @@ var remark = require('remark'), markdownAST = require('./markdown_ast'); * fs.writeFileSync('./output.md', output); * }); */ -function markdown(comments: Array, args: Object): Promise { +function markdown( + comments: Array, + args: Object = {} +): Promise { return markdownAST(comments, args).then(ast => remark().stringify(ast)); }