|
8 | 8 |
|
9 | 9 | ***[Try the jsdoc2md v2 pre-release](https://github.com/jsdoc2md/jsdoc-to-markdown/releases)*** |
10 | 10 |
|
11 | | -<a name="module_jsdoc-api"></a> |
| 11 | +# jsdoc-api |
12 | 12 |
|
13 | | -## jsdoc-api |
14 | 13 | A programmatic interface for [jsdoc3](https://github.com/jsdoc3/jsdoc) with a few features: |
15 | 14 |
|
16 | 15 | - Sync and async (Promise) interfaces on the two main jsdoc operations ('explain' and 'render documentation'). |
17 | 16 | - Input (source code) can supplied as a string or set of file names/globs. |
18 | 17 | - Optional caching, dramatically speeding up future invocations with the same input. |
19 | 18 | - Supports html input |
20 | 19 |
|
21 | | -**Example** |
| 20 | +## Synopsis |
| 21 | + |
22 | 22 | ```js |
23 | 23 | > const jsdoc = require('jsdoc-api') |
24 | 24 |
|
25 | | -> jsdoc.explainSync({ source: '/** example doclet *∕ \n var example = true' }) |
26 | | - |
| 25 | +> jsdoc.explainSync({ source: '/** example doclet */ \n var example = true' }) |
27 | 26 | [ { comment: '/** example doclet *∕', |
28 | | - meta: |
29 | | - { range: [ 28, 42 ], |
30 | | - filename: 'nkrf18zlymohia4i29a0zkyt84obt9.js', |
31 | | - lineno: 2, |
32 | | - path: '/var/folders/74/tqh7thm11tq72d7sjty9qvdh0000gn/T', |
33 | | - code: |
34 | | - { id: 'astnode100000002', |
35 | | - name: 'example', |
36 | | - type: 'Literal', |
37 | | - value: true } }, |
38 | | - description: 'example doclet', |
39 | | - name: 'example', |
40 | | - longname: 'example', |
41 | | - kind: 'member', |
42 | | - scope: 'global' }, |
43 | | - { kind: 'package', |
44 | | - longname: 'package:undefined', |
45 | | - files: [ '/var/folders/74/tqh7thm11tq72d7sjty9qvdh0000gn/T/nkrf18zlymohia4i29a0zkyt84obt9.js' ] } ] |
| 27 | + meta: |
| 28 | + { range: [ 28, 42 ], |
| 29 | + filename: 'nkrf18zlymohia4i29a0zkyt84obt9.js', |
| 30 | + lineno: 2, |
| 31 | + path: '/var/folders/74/tqh7thm11tq72d7sjty9qvdh0000gn/T', |
| 32 | + code: |
| 33 | + { id: 'astnode100000002', |
| 34 | + name: 'example', |
| 35 | + type: 'Literal', |
| 36 | + value: true } }, |
| 37 | + description: 'example doclet', |
| 38 | + name: 'example', |
| 39 | + longname: 'example', |
| 40 | + kind: 'member', |
| 41 | + scope: 'global' }, |
| 42 | + { kind: 'package', |
| 43 | + longname: 'package:undefined', |
| 44 | + files: [ '/var/folders/74/tqh7thm11tq72d7sjty9qvdh0000gn/T/nkrf18zlymohia4i29a0zkyt84obt9.js' ] } ] |
46 | 45 | ``` |
47 | 46 |
|
| 47 | +# API Reference |
| 48 | + |
| 49 | + |
48 | 50 | * [jsdoc-api](#module_jsdoc-api) |
49 | 51 | * _static_ |
50 | 52 | * [.cache](#module_jsdoc-api.cache) : <code>[cache-point](https://github.com/75lb/cache-point)</code> |
@@ -73,7 +75,7 @@ A programmatic interface for [jsdoc3](https://github.com/jsdoc3/jsdoc) with a fe |
73 | 75 | <a name="module_jsdoc-api.cache"></a> |
74 | 76 |
|
75 | 77 | ### jsdoc.cache : <code>[cache-point](https://github.com/75lb/cache-point)</code> |
76 | | -The [cache-point](https://github.com/75lb/cache-point) instance used when `cache: true` is specified on `.explain()`, `.explainSync()` or `.createExplainStream()`. |
| 78 | +The [cache-point](https://github.com/75lb/cache-point) instance used when `cache: true` is specified on `.explain()` or `.explainSync()`. |
77 | 79 |
|
78 | 80 | **Kind**: static property of <code>[jsdoc-api](#module_jsdoc-api)</code> |
79 | 81 | <a name="module_jsdoc-api.explainSync"></a> |
@@ -238,7 +240,6 @@ Enable experimental parsing of `.html` files. |
238 | 240 |
|
239 | 241 | **Kind**: instance property of <code>[JsdocOptions](#module_jsdoc-api..JsdocOptions)</code> |
240 | 242 |
|
241 | | - |
242 | 243 | * * * |
243 | 244 |
|
244 | 245 | © 2015-16 Lloyd Brookes \<[email protected]\>. Documented by [jsdoc-to-markdown ](https://github.com/jsdoc2md/jsdoc-to-markdown). |
0 commit comments