podlite 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/esm/ids.d.ts +18 -0
- package/esm/ids.js +69 -0
- package/esm/ids.js.map +1 -0
- package/esm/index.d.ts +7 -0
- package/esm/index.js +11 -0
- package/esm/index.js.map +1 -0
- package/esm/plugins/extrnal.d.ts +3 -0
- package/esm/plugins/extrnal.js +12 -0
- package/esm/plugins/extrnal.js.map +1 -0
- package/package.json +27 -14
- package/jest.config.js +0 -1
- package/jest.tsconfig.json +0 -1
- package/src/ids.ts +0 -76
- package/src/index.ts +0 -16
- package/src/plugins/extrnal.ts +0 -13
- package/t/fill-fixtures-md-to-pod6.ts +0 -28
- package/t/fixtures-md-to-pod6/00-main_1.txt +0 -12
- package/t/fixtures-md-to-pod6/00-main_broken_refs.txt +0 -18
- package/t/fixtures-md-to-pod6/00-main_images.txt +0 -10
- package/t/fixtures-md-to-pod6/00-main_link.txt +0 -7
- package/t/fixtures-md-to-pod6/00-main_links.txt +0 -24
- package/t/fixtures-md-to-pod6/01-node-api_1.txt +0 -561
- package/t/process.ts +0 -210
- package/t/test-api.ts +0 -35
- package/tsconfig.json +0 -31
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -1,561 +0,0 @@
|
|
|
1
|
-
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
2
|
-
|
|
3
|
-
### Table of Contents
|
|
4
|
-
|
|
5
|
-
- [lint][1]
|
|
6
|
-
- [Parameters][2]
|
|
7
|
-
- [Examples][3]
|
|
8
|
-
- [build][4]
|
|
9
|
-
- [Parameters][5]
|
|
10
|
-
- [Examples][6]
|
|
11
|
-
- [formats][7]
|
|
12
|
-
- [formats.html][8]
|
|
13
|
-
- [Parameters][9]
|
|
14
|
-
- [Examples][10]
|
|
15
|
-
- [formats.markdown][11]
|
|
16
|
-
- [Parameters][12]
|
|
17
|
-
- [Examples][13]
|
|
18
|
-
- [formats.json][14]
|
|
19
|
-
- [Parameters][15]
|
|
20
|
-
- [Examples][16]
|
|
21
|
-
|
|
22
|
-
## lint
|
|
23
|
-
|
|
24
|
-
Lint files for non-standard or incorrect documentation
|
|
25
|
-
information, returning a potentially-empty string
|
|
26
|
-
of lint information intended for human-readable output.
|
|
27
|
-
|
|
28
|
-
### SParameterssss
|
|
29
|
-
|
|
30
|
-
- `indexes` **([Array][17]<[string][18]> | [string][18])** files to process
|
|
31
|
-
- `args` **[Object][19]** args
|
|
32
|
-
- `args.external` **[Array][17]<[string][18]>** a string regex / glob match pattern
|
|
33
|
-
that defines what external modules will be whitelisted and included in the
|
|
34
|
-
generated documentation.
|
|
35
|
-
- `args.shallow` **[boolean][20]** whether to avoid dependency parsing
|
|
36
|
-
even in JavaScript code. (optional, default `false`)
|
|
37
|
-
- `args.inferPrivate` **[string][18]?** a valid regular expression string
|
|
38
|
-
to infer whether a code element should be private, given its naming structure.
|
|
39
|
-
For instance, you can specify `inferPrivate: '^_'` to automatically treat
|
|
40
|
-
methods named like `_myMethod` as private.
|
|
41
|
-
- `args.extension` **([string][18] \| [Array][17]<[string][18]>)?** treat additional file extensions
|
|
42
|
-
as JavaScript, extending the default set of `js`, `es6`, and `jsx`.
|
|
43
|
-
|
|
44
|
-
### Examples
|
|
45
|
-
|
|
46
|
-
```javascript
|
|
47
|
-
documentation.lint('file.js').then(lintOutput => {
|
|
48
|
-
if (lintOutput) {
|
|
49
|
-
console.log(lintOutput);
|
|
50
|
-
process.exit(1);
|
|
51
|
-
} else {
|
|
52
|
-
process.exit(0);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Returns **[Promise][21]** promise with lint results
|
|
58
|
-
|
|
59
|
-
## build
|
|
60
|
-
|
|
61
|
-
Generate JavaScript documentation as a list of parsed JSDoc
|
|
62
|
-
comments, given a root file as a path.
|
|
63
|
-
|
|
64
|
-
### Parameters
|
|
65
|
-
|
|
66
|
-
- `indexes` **([Array][17]<[string][18]> | [string][18])** files to process
|
|
67
|
-
- `args` **[Object][19]** args
|
|
68
|
-
- `args.external` **[Array][17]<[string][18]>** a string regex / glob match pattern
|
|
69
|
-
that defines what external modules will be whitelisted and included in the
|
|
70
|
-
generated documentation.
|
|
71
|
-
- `args.shallow` **[boolean][20]** whether to avoid dependency parsing
|
|
72
|
-
even in JavaScript code. (optional, default `false`)
|
|
73
|
-
- `args.order` **[Array][17]<([string][18] \| [Object][19])>** optional array that
|
|
74
|
-
defines sorting order of documentation (optional, default `[]`)
|
|
75
|
-
- `args.access` **[Array][17]<[string][18]>** an array of access levels
|
|
76
|
-
to output in documentation (optional, default `[]`)
|
|
77
|
-
- `args.hljs` **[Object][19]?** hljs optional args
|
|
78
|
-
- `args.hljs.highlightAuto` **[boolean][20]** hljs automatically detect language (optional, default `false`)
|
|
79
|
-
- `args.hljs.languages` **[Array][17]?** languages for hljs to choose from
|
|
80
|
-
- `args.inferPrivate` **[string][18]?** a valid regular expression string
|
|
81
|
-
to infer whether a code element should be private, given its naming structure.
|
|
82
|
-
For instance, you can specify `inferPrivate: '^_'` to automatically treat
|
|
83
|
-
methods named like `_myMethod` as private.
|
|
84
|
-
- `args.extension` **([string][18] \| [Array][17]<[string][18]>)?** treat additional file extensions
|
|
85
|
-
as JavaScript, extending the default set of `js`, `es6`, and `jsx`.
|
|
86
|
-
|
|
87
|
-
### Examples
|
|
88
|
-
|
|
89
|
-
```javascript
|
|
90
|
-
var documentation = require('documentation');
|
|
91
|
-
|
|
92
|
-
documentation.build(['index.js'], {
|
|
93
|
-
// only output comments with an explicit @public tag
|
|
94
|
-
access: ['public']
|
|
95
|
-
}).then(res => {
|
|
96
|
-
// res is an array of parsed comments with inferred properties
|
|
97
|
-
// and more: everything you need to build documentation or
|
|
98
|
-
// any other kind of code data.
|
|
99
|
-
});
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Returns **[Promise][21]** results
|
|
103
|
-
|
|
104
|
-
## formats
|
|
105
|
-
|
|
106
|
-
Documentation's formats are modular methods that take comments
|
|
107
|
-
and config as input and return Promises with results,
|
|
108
|
-
like stringified JSON, markdown strings, or Vinyl objects for HTML
|
|
109
|
-
output.
|
|
110
|
-
|
|
111
|
-
## formats.html
|
|
112
|
-
|
|
113
|
-
Formats documentation as HTML.
|
|
114
|
-
|
|
115
|
-
### Parameters
|
|
116
|
-
|
|
117
|
-
- `comments` **[Array][17]<[Comment][22]>** parsed comments
|
|
118
|
-
- `config` **[Object][19]** Options that can customize the output
|
|
119
|
-
- `config.theme` **[string][18]** Name of a module used for an HTML theme. (optional, default `'default_theme'`)
|
|
120
|
-
|
|
121
|
-
### Examples
|
|
122
|
-
|
|
123
|
-
```javascript
|
|
124
|
-
var documentation = require('documentation');
|
|
125
|
-
var streamArray = require('stream-array');
|
|
126
|
-
var vfs = require('vinyl-fs');
|
|
127
|
-
|
|
128
|
-
documentation.build(['index.js'])
|
|
129
|
-
.then(documentation.formats.html)
|
|
130
|
-
.then(output => {
|
|
131
|
-
streamArray(output).pipe(vfs.dest('./output-directory'));
|
|
132
|
-
});
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
Returns **[Promise][21]<[Array][17]<[Object][19]>>** Promise with results
|
|
136
|
-
|
|
137
|
-
## formats.markdown
|
|
138
|
-
|
|
139
|
-
Formats documentation as
|
|
140
|
-
[Markdown][23].
|
|
141
|
-
|
|
142
|
-
### Parameters
|
|
143
|
-
|
|
144
|
-
- `comments` **[Array][17]<[Object][19]>** parsed comments
|
|
145
|
-
- `args` **[Object][19]** Options that can customize the output
|
|
146
|
-
|
|
147
|
-
### Examples
|
|
148
|
-
|
|
149
|
-
```javascript
|
|
150
|
-
var documentation = require('documentation');
|
|
151
|
-
var fs = require('fs');
|
|
152
|
-
|
|
153
|
-
documentation.build(['index.js'])
|
|
154
|
-
.then(documentation.formats.md)
|
|
155
|
-
.then(output => {
|
|
156
|
-
// output is a string of Markdown data
|
|
157
|
-
fs.writeFileSync('./output.md', output);
|
|
158
|
-
});
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Returns **[Promise][21]<[string][18]>** a promise of the eventual value
|
|
162
|
-
|
|
163
|
-
## formats.json
|
|
164
|
-
|
|
165
|
-
Formats documentation as a JSON string.
|
|
166
|
-
|
|
167
|
-
### Parameters
|
|
168
|
-
|
|
169
|
-
- `comments` **[Array][17]<[Comment][22]>** parsed comments
|
|
170
|
-
|
|
171
|
-
### Examples
|
|
172
|
-
|
|
173
|
-
```javascript
|
|
174
|
-
var documentation = require('documentation');
|
|
175
|
-
var fs = require('fs');
|
|
176
|
-
|
|
177
|
-
documentation.build(['index.js'])
|
|
178
|
-
.then(documentation.formats.json)
|
|
179
|
-
.then(output => {
|
|
180
|
-
// output is a string of JSON data
|
|
181
|
-
fs.writeFileSync('./output.json', output);
|
|
182
|
-
});
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
Returns **[Promise][21]<[string][18]>**
|
|
186
|
-
|
|
187
|
-
[1]: #lint
|
|
188
|
-
|
|
189
|
-
[2]: #parameters
|
|
190
|
-
|
|
191
|
-
[3]: #examples
|
|
192
|
-
|
|
193
|
-
[4]: #build
|
|
194
|
-
|
|
195
|
-
[5]: #parameters-1
|
|
196
|
-
|
|
197
|
-
[6]: #examples-1
|
|
198
|
-
|
|
199
|
-
[7]: #formats
|
|
200
|
-
|
|
201
|
-
[8]: #formatshtml
|
|
202
|
-
|
|
203
|
-
[9]: #parameters-2
|
|
204
|
-
|
|
205
|
-
[10]: #examples-2
|
|
206
|
-
|
|
207
|
-
[11]: #formatsmarkdown
|
|
208
|
-
|
|
209
|
-
[12]: #parameters-3
|
|
210
|
-
|
|
211
|
-
[13]: #examples-3
|
|
212
|
-
|
|
213
|
-
[14]: #formatsjson
|
|
214
|
-
|
|
215
|
-
[15]: #parameters-4
|
|
216
|
-
|
|
217
|
-
[16]: #examples-4
|
|
218
|
-
|
|
219
|
-
[17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
220
|
-
|
|
221
|
-
[18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
222
|
-
|
|
223
|
-
[19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
224
|
-
|
|
225
|
-
[20]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
226
|
-
|
|
227
|
-
[21]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
228
|
-
|
|
229
|
-
[22]: https://developer.mozilla.org/docs/Web/API/Comment/Comment
|
|
230
|
-
|
|
231
|
-
[23]: https://daringfireball.net/projects/markdown/
|
|
232
|
-
|
|
233
|
-
~~~~~~~
|
|
234
|
-
=begin pod
|
|
235
|
-
=begin Html
|
|
236
|
-
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
237
|
-
=end Html
|
|
238
|
-
=head3 Table of Contents
|
|
239
|
-
=begin item1 :numbered
|
|
240
|
-
=begin para
|
|
241
|
-
L<lint|#lint>
|
|
242
|
-
=end para
|
|
243
|
-
=begin item2 :numbered
|
|
244
|
-
=begin para
|
|
245
|
-
L<Parameters|#parameters>
|
|
246
|
-
=end para
|
|
247
|
-
=end item2
|
|
248
|
-
=begin item2 :numbered
|
|
249
|
-
=begin para
|
|
250
|
-
L<Examples|#examples>
|
|
251
|
-
=end para
|
|
252
|
-
=end item2
|
|
253
|
-
=end item1
|
|
254
|
-
=begin item1 :numbered
|
|
255
|
-
=begin para
|
|
256
|
-
L<build|#build>
|
|
257
|
-
=end para
|
|
258
|
-
=begin item2 :numbered
|
|
259
|
-
=begin para
|
|
260
|
-
L<Parameters|#parameters-1>
|
|
261
|
-
=end para
|
|
262
|
-
=end item2
|
|
263
|
-
=begin item2 :numbered
|
|
264
|
-
=begin para
|
|
265
|
-
L<Examples|#examples-1>
|
|
266
|
-
=end para
|
|
267
|
-
=end item2
|
|
268
|
-
=end item1
|
|
269
|
-
=begin item1 :numbered
|
|
270
|
-
=begin para
|
|
271
|
-
L<formats|#formats>
|
|
272
|
-
=end para
|
|
273
|
-
=end item1
|
|
274
|
-
=begin item1 :numbered
|
|
275
|
-
=begin para
|
|
276
|
-
L<formats.html|#formatshtml>
|
|
277
|
-
=end para
|
|
278
|
-
=begin item2 :numbered
|
|
279
|
-
=begin para
|
|
280
|
-
L<Parameters|#parameters-2>
|
|
281
|
-
=end para
|
|
282
|
-
=end item2
|
|
283
|
-
=begin item2 :numbered
|
|
284
|
-
=begin para
|
|
285
|
-
L<Examples|#examples-2>
|
|
286
|
-
=end para
|
|
287
|
-
=end item2
|
|
288
|
-
=end item1
|
|
289
|
-
=begin item1 :numbered
|
|
290
|
-
=begin para
|
|
291
|
-
L<formats.markdown|#formatsmarkdown>
|
|
292
|
-
=end para
|
|
293
|
-
=begin item2 :numbered
|
|
294
|
-
=begin para
|
|
295
|
-
L<Parameters|#parameters-3>
|
|
296
|
-
=end para
|
|
297
|
-
=end item2
|
|
298
|
-
=begin item2 :numbered
|
|
299
|
-
=begin para
|
|
300
|
-
L<Examples|#examples-3>
|
|
301
|
-
=end para
|
|
302
|
-
=end item2
|
|
303
|
-
=end item1
|
|
304
|
-
=begin item1 :numbered
|
|
305
|
-
=begin para
|
|
306
|
-
L<formats.json|#formatsjson>
|
|
307
|
-
=end para
|
|
308
|
-
=begin item2 :numbered
|
|
309
|
-
=begin para
|
|
310
|
-
L<Parameters|#parameters-4>
|
|
311
|
-
=end para
|
|
312
|
-
=end item2
|
|
313
|
-
=begin item2 :numbered
|
|
314
|
-
=begin para
|
|
315
|
-
L<Examples|#examples-4>
|
|
316
|
-
=end para
|
|
317
|
-
=end item2
|
|
318
|
-
=end item1
|
|
319
|
-
=head2 lint
|
|
320
|
-
=begin para
|
|
321
|
-
Lint files for non-standard or incorrect documentation
|
|
322
|
-
information, returning a potentially-empty string
|
|
323
|
-
of lint information intended for human-readable output.
|
|
324
|
-
=end para
|
|
325
|
-
=head3 SParameterssss
|
|
326
|
-
=begin item1 :numbered
|
|
327
|
-
=begin para
|
|
328
|
-
C<indexes> B<(L<Array|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array><L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>> | L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>)> files to process
|
|
329
|
-
=end para
|
|
330
|
-
=end item1
|
|
331
|
-
=begin item1 :numbered
|
|
332
|
-
=begin para
|
|
333
|
-
C<args> B<L<Object|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object>> args
|
|
334
|
-
=end para
|
|
335
|
-
=begin item2 :numbered
|
|
336
|
-
=begin para
|
|
337
|
-
C<args.external> B<L<Array|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array><L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>>> a string regex / glob match pattern
|
|
338
|
-
that defines what external modules will be whitelisted and included in the
|
|
339
|
-
generated documentation.
|
|
340
|
-
=end para
|
|
341
|
-
=end item2
|
|
342
|
-
=begin item2 :numbered
|
|
343
|
-
=begin para
|
|
344
|
-
C<args.shallow> B<L<boolean|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean>> whether to avoid dependency parsing
|
|
345
|
-
even in JavaScript code. (optional, default C<false>)
|
|
346
|
-
=end para
|
|
347
|
-
=end item2
|
|
348
|
-
=begin item2 :numbered
|
|
349
|
-
=begin para
|
|
350
|
-
C<args.inferPrivate> B<L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>?> a valid regular expression string
|
|
351
|
-
to infer whether a code element should be private, given its naming structure.
|
|
352
|
-
For instance, you can specify C<inferPrivate: '^_'> to automatically treat
|
|
353
|
-
methods named like C<_myMethod> as private.
|
|
354
|
-
=end para
|
|
355
|
-
=end item2
|
|
356
|
-
=begin item2 :numbered
|
|
357
|
-
=begin para
|
|
358
|
-
C<args.extension> B<(L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String> | L<Array|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array><L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>>)?> treat additional file extensions
|
|
359
|
-
as JavaScript, extending the default set of C<js>, C<es6>, and C<jsx>.
|
|
360
|
-
=end para
|
|
361
|
-
=end item2
|
|
362
|
-
=end item1
|
|
363
|
-
=head3 Examples
|
|
364
|
-
=begin code :lang('javascript')
|
|
365
|
-
documentation.lint('file.js').then(lintOutput => {
|
|
366
|
-
if (lintOutput) {
|
|
367
|
-
console.log(lintOutput);
|
|
368
|
-
process.exit(1);
|
|
369
|
-
} else {
|
|
370
|
-
process.exit(0);
|
|
371
|
-
}
|
|
372
|
-
});
|
|
373
|
-
=end code
|
|
374
|
-
=begin para
|
|
375
|
-
Returns B<L<Promise|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise>> promise with lint results
|
|
376
|
-
=end para
|
|
377
|
-
=head2 build
|
|
378
|
-
=begin para
|
|
379
|
-
Generate JavaScript documentation as a list of parsed JSDoc
|
|
380
|
-
comments, given a root file as a path.
|
|
381
|
-
=end para
|
|
382
|
-
=head3 Parameters
|
|
383
|
-
=begin item1 :numbered
|
|
384
|
-
=begin para
|
|
385
|
-
C<indexes> B<(L<Array|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array><L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>> | L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>)> files to process
|
|
386
|
-
=end para
|
|
387
|
-
=end item1
|
|
388
|
-
=begin item1 :numbered
|
|
389
|
-
=begin para
|
|
390
|
-
C<args> B<L<Object|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object>> args
|
|
391
|
-
=end para
|
|
392
|
-
=begin item2 :numbered
|
|
393
|
-
=begin para
|
|
394
|
-
C<args.external> B<L<Array|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array><L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>>> a string regex / glob match pattern
|
|
395
|
-
that defines what external modules will be whitelisted and included in the
|
|
396
|
-
generated documentation.
|
|
397
|
-
=end para
|
|
398
|
-
=end item2
|
|
399
|
-
=begin item2 :numbered
|
|
400
|
-
=begin para
|
|
401
|
-
C<args.shallow> B<L<boolean|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean>> whether to avoid dependency parsing
|
|
402
|
-
even in JavaScript code. (optional, default C<false>)
|
|
403
|
-
=end para
|
|
404
|
-
=end item2
|
|
405
|
-
=begin item2 :numbered
|
|
406
|
-
=begin para
|
|
407
|
-
C<args.order> B<L<Array|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array><(L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String> | L<Object|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object>)>> optional array that
|
|
408
|
-
defines sorting order of documentation (optional, default C<[]>)
|
|
409
|
-
=end para
|
|
410
|
-
=end item2
|
|
411
|
-
=begin item2 :numbered
|
|
412
|
-
=begin para
|
|
413
|
-
C<args.access> B<L<Array|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array><L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>>> an array of access levels
|
|
414
|
-
to output in documentation (optional, default C<[]>)
|
|
415
|
-
=end para
|
|
416
|
-
=end item2
|
|
417
|
-
=begin item2 :numbered
|
|
418
|
-
=begin para
|
|
419
|
-
C<args.hljs> B<L<Object|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object>?> hljs optional args
|
|
420
|
-
=end para
|
|
421
|
-
=begin item3 :numbered
|
|
422
|
-
=begin para
|
|
423
|
-
C<args.hljs.highlightAuto> B<L<boolean|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean>> hljs automatically detect language (optional, default C<false>)
|
|
424
|
-
=end para
|
|
425
|
-
=end item3
|
|
426
|
-
=begin item3 :numbered
|
|
427
|
-
=begin para
|
|
428
|
-
C<args.hljs.languages> B<L<Array|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array>?> languages for hljs to choose from
|
|
429
|
-
=end para
|
|
430
|
-
=end item3
|
|
431
|
-
=end item2
|
|
432
|
-
=begin item2 :numbered
|
|
433
|
-
=begin para
|
|
434
|
-
C<args.inferPrivate> B<L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>?> a valid regular expression string
|
|
435
|
-
to infer whether a code element should be private, given its naming structure.
|
|
436
|
-
For instance, you can specify C<inferPrivate: '^_'> to automatically treat
|
|
437
|
-
methods named like C<_myMethod> as private.
|
|
438
|
-
=end para
|
|
439
|
-
=end item2
|
|
440
|
-
=begin item2 :numbered
|
|
441
|
-
=begin para
|
|
442
|
-
C<args.extension> B<(L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String> | L<Array|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array><L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>>)?> treat additional file extensions
|
|
443
|
-
as JavaScript, extending the default set of C<js>, C<es6>, and C<jsx>.
|
|
444
|
-
=end para
|
|
445
|
-
=end item2
|
|
446
|
-
=end item1
|
|
447
|
-
=head3 Examples
|
|
448
|
-
=begin code :lang('javascript')
|
|
449
|
-
var documentation = require('documentation');
|
|
450
|
-
|
|
451
|
-
documentation.build(['index.js'], {
|
|
452
|
-
// only output comments with an explicit @public tag
|
|
453
|
-
access: ['public']
|
|
454
|
-
}).then(res => {
|
|
455
|
-
// res is an array of parsed comments with inferred properties
|
|
456
|
-
// and more: everything you need to build documentation or
|
|
457
|
-
// any other kind of code data.
|
|
458
|
-
});
|
|
459
|
-
=end code
|
|
460
|
-
=begin para
|
|
461
|
-
Returns B<L<Promise|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise>> results
|
|
462
|
-
=end para
|
|
463
|
-
=head2 formats
|
|
464
|
-
=begin para
|
|
465
|
-
Documentation's formats are modular methods that take comments
|
|
466
|
-
and config as input and return Promises with results,
|
|
467
|
-
like stringified JSON, markdown strings, or Vinyl objects for HTML
|
|
468
|
-
output.
|
|
469
|
-
=end para
|
|
470
|
-
=head2 formats.html
|
|
471
|
-
=begin para
|
|
472
|
-
Formats documentation as HTML.
|
|
473
|
-
=end para
|
|
474
|
-
=head3 Parameters
|
|
475
|
-
=begin item1 :numbered
|
|
476
|
-
=begin para
|
|
477
|
-
C<comments> B<L<Array|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array><L<Comment|https://developer.mozilla.org/docs/Web/API/Comment/Comment>>> parsed comments
|
|
478
|
-
=end para
|
|
479
|
-
=end item1
|
|
480
|
-
=begin item1 :numbered
|
|
481
|
-
=begin para
|
|
482
|
-
C<config> B<L<Object|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object>> Options that can customize the output
|
|
483
|
-
=end para
|
|
484
|
-
=begin item2 :numbered
|
|
485
|
-
=begin para
|
|
486
|
-
C<config.theme> B<L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>> Name of a module used for an HTML theme. (optional, default C<'default_theme'>)
|
|
487
|
-
=end para
|
|
488
|
-
=end item2
|
|
489
|
-
=end item1
|
|
490
|
-
=head3 Examples
|
|
491
|
-
=begin code :lang('javascript')
|
|
492
|
-
var documentation = require('documentation');
|
|
493
|
-
var streamArray = require('stream-array');
|
|
494
|
-
var vfs = require('vinyl-fs');
|
|
495
|
-
|
|
496
|
-
documentation.build(['index.js'])
|
|
497
|
-
.then(documentation.formats.html)
|
|
498
|
-
.then(output => {
|
|
499
|
-
streamArray(output).pipe(vfs.dest('./output-directory'));
|
|
500
|
-
});
|
|
501
|
-
=end code
|
|
502
|
-
=begin para
|
|
503
|
-
Returns B<L<Promise|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise><L<Array|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array><L<Object|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object>>>> Promise with results
|
|
504
|
-
=end para
|
|
505
|
-
=head2 formats.markdown
|
|
506
|
-
=begin para
|
|
507
|
-
Formats documentation as
|
|
508
|
-
L<Markdown|https://daringfireball.net/projects/markdown/>.
|
|
509
|
-
=end para
|
|
510
|
-
=head3 Parameters
|
|
511
|
-
=begin item1 :numbered
|
|
512
|
-
=begin para
|
|
513
|
-
C<comments> B<L<Array|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array><L<Object|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object>>> parsed comments
|
|
514
|
-
=end para
|
|
515
|
-
=end item1
|
|
516
|
-
=begin item1 :numbered
|
|
517
|
-
=begin para
|
|
518
|
-
C<args> B<L<Object|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object>> Options that can customize the output
|
|
519
|
-
=end para
|
|
520
|
-
=end item1
|
|
521
|
-
=head3 Examples
|
|
522
|
-
=begin code :lang('javascript')
|
|
523
|
-
var documentation = require('documentation');
|
|
524
|
-
var fs = require('fs');
|
|
525
|
-
|
|
526
|
-
documentation.build(['index.js'])
|
|
527
|
-
.then(documentation.formats.md)
|
|
528
|
-
.then(output => {
|
|
529
|
-
// output is a string of Markdown data
|
|
530
|
-
fs.writeFileSync('./output.md', output);
|
|
531
|
-
});
|
|
532
|
-
=end code
|
|
533
|
-
=begin para
|
|
534
|
-
Returns B<L<Promise|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise><L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>>> a promise of the eventual value
|
|
535
|
-
=end para
|
|
536
|
-
=head2 formats.json
|
|
537
|
-
=begin para
|
|
538
|
-
Formats documentation as a JSON string.
|
|
539
|
-
=end para
|
|
540
|
-
=head3 Parameters
|
|
541
|
-
=begin item1 :numbered
|
|
542
|
-
=begin para
|
|
543
|
-
C<comments> B<L<Array|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array><L<Comment|https://developer.mozilla.org/docs/Web/API/Comment/Comment>>> parsed comments
|
|
544
|
-
=end para
|
|
545
|
-
=end item1
|
|
546
|
-
=head3 Examples
|
|
547
|
-
=begin code :lang('javascript')
|
|
548
|
-
var documentation = require('documentation');
|
|
549
|
-
var fs = require('fs');
|
|
550
|
-
|
|
551
|
-
documentation.build(['index.js'])
|
|
552
|
-
.then(documentation.formats.json)
|
|
553
|
-
.then(output => {
|
|
554
|
-
// output is a string of JSON data
|
|
555
|
-
fs.writeFileSync('./output.json', output);
|
|
556
|
-
});
|
|
557
|
-
=end code
|
|
558
|
-
=begin para
|
|
559
|
-
Returns B<L<Promise|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise><L<string|https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>>>
|
|
560
|
-
=end para
|
|
561
|
-
=end pod
|