Skip to content

Commit fc58beb

Browse files
committed
Document new inferPrivate and extension options
1 parent f926b3d commit fc58beb

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

docs/NODE_API.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ comments, given a root file as a path.
2424
- `options.hljs` **\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** hljs optional options
2525
- `options.hljs.highlightAuto` **\[[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** hljs automatically detect language (optional, default `false`)
2626
- `options.hljs.languages` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)]** languages for hljs to choose from
27+
- `options.inferPrivate` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** a valid regular expression string
28+
to infer whether a code element should be private, given its naming structure.
29+
For instance, you can specify `inferPrivate: '^_'` to automatically treat
30+
methods named like `_myMethod` as private.
31+
- `options.extension` **\[([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>)]** treat additional file extensions
32+
as JavaScript, extending the default set of `js`, `es6`, and `jsx`.
2733
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** to be called when the documentation generation
2834
is complete, with (err, result) argumentsj
2935

@@ -73,6 +79,12 @@ synchronously, rather than by calling a callback.
7379
- `options.hljs` **\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** hljs optional options
7480
- `options.hljs.highlightAuto` **\[[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** hljs automatically detect language (optional, default `false`)
7581
- `options.hljs.languages` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)]** languages for hljs to choose from
82+
- `options.inferPrivate` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** a valid regular expression string
83+
to infer whether a code element should be private, given its naming structure.
84+
For instance, you can specify `inferPrivate: '^_'` to automatically treat
85+
methods named like `_myMethod` as private.
86+
- `options.extension` **\[([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>)]** treat additional file extensions
87+
as JavaScript, extending the default set of `js`, `es6`, and `jsx`.
7688

7789
**Examples**
7890

@@ -105,6 +117,12 @@ of lint information intended for human-readable output.
105117
reduces documentation's ability to infer structure of code. (optional, default `false`)
106118
- `options.shallow` **\[[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** whether to avoid dependency parsing
107119
even in JavaScript code. With the polyglot option set, this has no effect. (optional, default `false`)
120+
- `options.inferPrivate` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** a valid regular expression string
121+
to infer whether a code element should be private, given its naming structure.
122+
For instance, you can specify `inferPrivate: '^_'` to automatically treat
123+
methods named like `_myMethod` as private.
124+
- `options.extension` **\[([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>)]** treat additional file extensions
125+
as JavaScript, extending the default set of `js`, `es6`, and `jsx`.
108126
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** to be called when the documentation generation
109127
is complete, with (err, result) arguments
110128

index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ function expandInputs(indexes, options, callback) {
8585
* @param {Object} [options.hljs] hljs optional options
8686
* @param {boolean} [options.hljs.highlightAuto=false] hljs automatically detect language
8787
* @param {Array} [options.hljs.languages] languages for hljs to choose from
88+
* @param {string} [options.inferPrivate] a valid regular expression string
89+
* to infer whether a code element should be private, given its naming structure.
90+
* For instance, you can specify `inferPrivate: '^_'` to automatically treat
91+
* methods named like `_myMethod` as private.
92+
* @param {string|Array<string>} [options.extension] treat additional file extensions
93+
* as JavaScript, extending the default set of `js`, `es6`, and `jsx`.
8894
* @param {Function} callback to be called when the documentation generation
8995
* is complete, with (err, result) argumentsj
9096
* @returns {undefined} calls callback
@@ -146,6 +152,12 @@ function build(indexes, options, callback) {
146152
* @param {Object} [options.hljs] hljs optional options
147153
* @param {boolean} [options.hljs.highlightAuto=false] hljs automatically detect language
148154
* @param {Array} [options.hljs.languages] languages for hljs to choose from
155+
* @param {string} [options.inferPrivate] a valid regular expression string
156+
* to infer whether a code element should be private, given its naming structure.
157+
* For instance, you can specify `inferPrivate: '^_'` to automatically treat
158+
* methods named like `_myMethod` as private.
159+
* @param {string|Array<string>} [options.extension] treat additional file extensions
160+
* as JavaScript, extending the default set of `js`, `es6`, and `jsx`.
149161
* @returns {Object} list of results
150162
* @public
151163
* @example
@@ -221,6 +233,12 @@ function buildSync(indexes, options) {
221233
* reduces documentation's ability to infer structure of code.
222234
* @param {boolean} [options.shallow=false] whether to avoid dependency parsing
223235
* even in JavaScript code. With the polyglot option set, this has no effect.
236+
* @param {string} [options.inferPrivate] a valid regular expression string
237+
* to infer whether a code element should be private, given its naming structure.
238+
* For instance, you can specify `inferPrivate: '^_'` to automatically treat
239+
* methods named like `_myMethod` as private.
240+
* @param {string|Array<string>} [options.extension] treat additional file extensions
241+
* as JavaScript, extending the default set of `js`, `es6`, and `jsx`.
224242
* @param {Function} callback to be called when the documentation generation
225243
* is complete, with (err, result) arguments
226244
* @returns {undefined} calls callback

0 commit comments

Comments
 (0)