Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"presets": ["flow"],
"plugins": [
["transform-es2015-modules-commonjs", {
"allowTopLevelThis": true
}]
]
"presets": ["es2015", "stage-0", "flow"],
"plugins": ["syntax-async-functions"]
}
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
machine:
node:
version: 7
version: 4
test:
override:
- npm run test-ci
Expand Down
4 changes: 2 additions & 2 deletions docs/NODE_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (optional, default `{}`)
- `config` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output
- `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**
Expand All @@ -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 (optional, default `{}`)
- `args` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output

**Examples**

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"babel-cli": "^6.24.1",
"babel-eslint": "^7.2.3",
"babel-jest": "^20.0.1",
"babel-plugin-syntax-async-functions": "^6.13.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.24.1",
"babel-preset-flow": "^6.23.0",
"chdir": "0.0.0",
Expand All @@ -79,6 +80,7 @@
"mock-fs": "^4.2.0",
"p-event": "^1.0.0",
"prettier": "^1.0.0",
"regenerator-runtime": "^0.10.5",
"standard-version": "^4.0.0",
"tmp": "^0.0.31"
},
Expand Down
5 changes: 4 additions & 1 deletion src/output/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ var mergeConfig = require('../merge_config');
* streamArray(output).pipe(vfs.dest('./output-directory'));
* });
*/
function html(comments: Array<Comment>, config: Object = {}) {
function html(comments: Array<Comment>, config?: Object) {
if (!config) {
config = {};
}
return mergeConfig(config).then((config: DocumentationConfig) => {
var themePath = '../default_theme/';
if (config.theme) {
Expand Down
8 changes: 4 additions & 4 deletions src/output/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ var remark = require('remark'),
* fs.writeFileSync('./output.md', output);
* });
*/
function markdown(
comments: Array<Comment>,
args: Object = {}
): Promise<string> {
function markdown(comments: Array<Comment>, args?: Object): Promise<string> {
if (!args) {
args = {};
}
return markdownAST(comments, args).then(ast => remark().stringify(ast));
}

Expand Down