agent-docs 1.0.0
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/.cursor/plans/OPTIMISE.md +379 -0
- package/.cursor/plans/VERSIONING.md +207 -0
- package/.cursor/rules/IMPORTANT.mdc +97 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +13 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +17 -0
- package/.github/dependabot.yml +38 -0
- package/.github/pull_request_template.md +10 -0
- package/.github/workflows/format.yml +35 -0
- package/CODE_OF_CONDUCT.md +64 -0
- package/CONTRIBUTING.md +52 -0
- package/LICENSE.md +20 -0
- package/PLAN.md +707 -0
- package/README.md +133 -0
- package/SECURITY.md +21 -0
- package/docs/APEXANNOTATIONS.md +472 -0
- package/docs/APEXDOC.md +198 -0
- package/docs/CML.md +877 -0
- package/docs/CODEANALYZER.md +435 -0
- package/docs/CONTEXTDEFINITIONS.md +617 -0
- package/docs/ESLINT.md +827 -0
- package/docs/ESLINTJSDOC.md +520 -0
- package/docs/FIELDSERVICE.md +4452 -0
- package/docs/GRAPHBINARY.md +208 -0
- package/docs/GRAPHENGINE.md +616 -0
- package/docs/GRAPHML.md +337 -0
- package/docs/GRAPHSON.md +302 -0
- package/docs/GREMLIN.md +490 -0
- package/docs/GRYO.md +232 -0
- package/docs/HUSKY.md +106 -0
- package/docs/JEST.md +387 -0
- package/docs/JORJE.md +537 -0
- package/docs/JSDOC.md +621 -0
- package/docs/PMD.md +910 -0
- package/docs/PNPM.md +409 -0
- package/docs/PRETTIER.md +716 -0
- package/docs/PRETTIERAPEX.md +874 -0
- package/docs/REVENUETRANSACTIONMANAGEMENT.md +887 -0
- package/docs/TINKERPOP.md +252 -0
- package/docs/VITEST.md +706 -0
- package/docs/VSCODE.md +231 -0
- package/docs/XPATH31.md +213 -0
- package/package.json +32 -0
- package/postinstall.mjs +51 -0
- package/prettier.config.js +18 -0
package/docs/JSDOC.md
ADDED
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
# JSDoc Reference
|
|
2
|
+
|
|
3
|
+
> **Version**: 1.0.0
|
|
4
|
+
|
|
5
|
+
> **Purpose**: API documentation generator for JavaScript. Extracts `/** ... */`
|
|
6
|
+
> comments → HTML docs. **Node**: ^20.19.0 | ^22.12.0 | >=23.0.0 (JSDoc 5.x)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Install
|
|
14
|
+
npm install -g jsdoc # Global
|
|
15
|
+
npm install --save-dev jsdoc # Local
|
|
16
|
+
|
|
17
|
+
# Run
|
|
18
|
+
jsdoc file.js # Single file
|
|
19
|
+
jsdoc -r src/ # Recursive
|
|
20
|
+
jsdoc -c conf.json # With config
|
|
21
|
+
jsdoc -d docs/ file.js # Custom output dir
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Default output**: `out/` directory
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## CLI Options
|
|
29
|
+
|
|
30
|
+
| Option | Short | Description |
|
|
31
|
+
| --------------- | ----- | ------------------------------------ |
|
|
32
|
+
| `--configure` | `-c` | Config file path |
|
|
33
|
+
| `--destination` | `-d` | Output directory (default: `./out/`) |
|
|
34
|
+
| `--recurse` | `-r` | Recurse into subdirectories |
|
|
35
|
+
| `--private` | — | Include `@private` symbols |
|
|
36
|
+
| `--package` | `-P` | Include `package.json` info |
|
|
37
|
+
| `--readme` | `-R` | Include README file |
|
|
38
|
+
| `--tutorials` | `-u` | Tutorials directory |
|
|
39
|
+
| `--template` | `-t` | Template directory |
|
|
40
|
+
| `--encoding` | `-e` | File encoding (default: `utf8`) |
|
|
41
|
+
| `--explain` | `-X` | Output doclets as JSON |
|
|
42
|
+
| `--help` | `-h` | Show help |
|
|
43
|
+
| `--version` | `-v` | Show version |
|
|
44
|
+
| `--verbose` | — | Verbose output |
|
|
45
|
+
| `--pedantic` | — | Treat warnings as errors |
|
|
46
|
+
| `--query` | `-q` | Query string for template |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Configuration
|
|
51
|
+
|
|
52
|
+
### File Formats
|
|
53
|
+
|
|
54
|
+
**JSON** (conf.json) — supports comments in JSDoc 3.3.0+:
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"source": {
|
|
59
|
+
"include": ["src/"],
|
|
60
|
+
"exclude": ["src/tests/"],
|
|
61
|
+
"includePattern": ".+\\.js(doc|x)?$",
|
|
62
|
+
"excludePattern": "(^|\\/|\\\\)_"
|
|
63
|
+
},
|
|
64
|
+
"sourceType": "module",
|
|
65
|
+
"plugins": ["plugins/markdown"],
|
|
66
|
+
"recurseDepth": 10,
|
|
67
|
+
"tags": {
|
|
68
|
+
"allowUnknownTags": true,
|
|
69
|
+
"dictionaries": ["jsdoc", "closure"]
|
|
70
|
+
},
|
|
71
|
+
"templates": {
|
|
72
|
+
"cleverLinks": false,
|
|
73
|
+
"monospaceLinks": false,
|
|
74
|
+
"default": { "outputSourceFiles": true }
|
|
75
|
+
},
|
|
76
|
+
"opts": {
|
|
77
|
+
"destination": "./out/",
|
|
78
|
+
"recurse": true,
|
|
79
|
+
"tutorials": "tutorials/"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**CommonJS** (conf.js) — JSDoc 3.5.0+:
|
|
85
|
+
|
|
86
|
+
```javascript
|
|
87
|
+
module.exports = {
|
|
88
|
+
/* same structure */
|
|
89
|
+
};
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Configuration Options
|
|
93
|
+
|
|
94
|
+
| Option | Type | Default | Description |
|
|
95
|
+
| -------------------------- | ------- | --------------------- | ----------------------------- |
|
|
96
|
+
| `source.include` | array | `[]` | Paths to include |
|
|
97
|
+
| `source.exclude` | array | `[]` | Paths to exclude (precedence) |
|
|
98
|
+
| `source.includePattern` | string | `".+\\.js(doc\|x)?$"` | File match regex |
|
|
99
|
+
| `source.excludePattern` | string | `"(^\|\/\|\\\\)_"` | File exclude regex |
|
|
100
|
+
| `sourceType` | string | `"module"` | `"module"` or `"script"` |
|
|
101
|
+
| `plugins` | array | `[]` | Plugin paths |
|
|
102
|
+
| `recurseDepth` | number | `10` | Max recursion depth |
|
|
103
|
+
| `tags.allowUnknownTags` | boolean | `true` | Allow custom tags |
|
|
104
|
+
| `tags.dictionaries` | array | `["jsdoc","closure"]` | Tag dictionaries |
|
|
105
|
+
| `templates.cleverLinks` | boolean | `false` | Smart link rendering |
|
|
106
|
+
| `templates.monospaceLinks` | boolean | `false` | Monospace links |
|
|
107
|
+
| `opts.destination` | string | `"./out/"` | Output directory |
|
|
108
|
+
| `opts.recurse` | boolean | `false` | Recurse subdirs |
|
|
109
|
+
| `opts.private` | boolean | `false` | Include private |
|
|
110
|
+
| `opts.tutorials` | string | `null` | Tutorials path |
|
|
111
|
+
| `opts.template` | string | `null` | Template path |
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Block Tags
|
|
116
|
+
|
|
117
|
+
| Tag | Description | Syntax |
|
|
118
|
+
| -------------- | -------------------- | ------------------------------------ |
|
|
119
|
+
| `@abstract` | Abstract member | `@abstract` |
|
|
120
|
+
| `@access` | Access level | `@access private\|protected\|public` |
|
|
121
|
+
| `@alias` | Alias name | `@alias name` |
|
|
122
|
+
| `@async` | Async function | `@async` |
|
|
123
|
+
| `@augments` | Extends class | `@augments ClassName` |
|
|
124
|
+
| `@author` | Author | `@author Name <email>` |
|
|
125
|
+
| `@borrows` | Borrow docs | `@borrows path as alias` |
|
|
126
|
+
| `@callback` | Callback typedef | `@callback Name` |
|
|
127
|
+
| `@class` | Class | `@class [Name]` |
|
|
128
|
+
| `@constant` | Constant | `@constant {type}` |
|
|
129
|
+
| `@constructor` | Constructor | `@constructor` |
|
|
130
|
+
| `@copyright` | Copyright | `@copyright text` |
|
|
131
|
+
| `@default` | Default value | `@default [value]` |
|
|
132
|
+
| `@deprecated` | Deprecated | `@deprecated [message]` |
|
|
133
|
+
| `@description` | Description | `@description text` |
|
|
134
|
+
| `@enum` | Enum | `@enum {type}` |
|
|
135
|
+
| `@event` | Event | `@event Name` |
|
|
136
|
+
| `@example` | Example code | `@example` + code block |
|
|
137
|
+
| `@exports` | Module export | `@exports moduleName` |
|
|
138
|
+
| `@extends` | Alias for @augments | `@extends ClassName` |
|
|
139
|
+
| `@external` | External symbol | `@external Name` |
|
|
140
|
+
| `@file` | File description | `@file description` |
|
|
141
|
+
| `@fires` | Fires event | `@fires EventName` |
|
|
142
|
+
| `@function` | Function | `@function [name]` |
|
|
143
|
+
| `@global` | Global symbol | `@global` |
|
|
144
|
+
| `@ignore` | Ignore in docs | `@ignore` |
|
|
145
|
+
| `@implements` | Implements interface | `@implements Interface` |
|
|
146
|
+
| `@inheritdoc` | Inherit docs | `@inheritdoc` |
|
|
147
|
+
| `@inner` | Inner member | `@inner` |
|
|
148
|
+
| `@instance` | Instance member | `@instance` |
|
|
149
|
+
| `@interface` | Interface | `@interface [Name]` |
|
|
150
|
+
| `@kind` | Symbol kind | `@kind class\|function\|...` |
|
|
151
|
+
| `@lends` | Lends properties | `@lends ClassName#` |
|
|
152
|
+
| `@license` | License | `@license identifier` |
|
|
153
|
+
| `@member` | Member | `@member {type} [name]` |
|
|
154
|
+
| `@memberof` | Parent | `@memberof ParentName` |
|
|
155
|
+
| `@method` | Method | `@method [name]` |
|
|
156
|
+
| `@mixes` | Mixes in | `@mixes MixinName` |
|
|
157
|
+
| `@mixin` | Mixin | `@mixin [Name]` |
|
|
158
|
+
| `@module` | Module | `@module [name]` |
|
|
159
|
+
| `@name` | Force name | `@name symbolName` |
|
|
160
|
+
| `@namespace` | Namespace | `@namespace [Name]` |
|
|
161
|
+
| `@override` | Override | `@override` |
|
|
162
|
+
| `@param` | Parameter | `@param {type} name - desc` |
|
|
163
|
+
| `@private` | Private | `@private` |
|
|
164
|
+
| `@property` | Property | `@property {type} name - desc` |
|
|
165
|
+
| `@protected` | Protected | `@protected` |
|
|
166
|
+
| `@public` | Public | `@public` |
|
|
167
|
+
| `@readonly` | Read-only | `@readonly` |
|
|
168
|
+
| `@requires` | Requires module | `@requires module:name` |
|
|
169
|
+
| `@returns` | Return value | `@returns {type} desc` |
|
|
170
|
+
| `@see` | See also | `@see namepath` |
|
|
171
|
+
| `@since` | Since version | `@since version` |
|
|
172
|
+
| `@static` | Static member | `@static` |
|
|
173
|
+
| `@summary` | Short summary | `@summary text` |
|
|
174
|
+
| `@this` | This context | `@this ClassName` |
|
|
175
|
+
| `@throws` | Exception | `@throws {type} desc` |
|
|
176
|
+
| `@todo` | Todo | `@todo text` |
|
|
177
|
+
| `@tutorial` | Tutorial link | `@tutorial tutorialId` |
|
|
178
|
+
| `@type` | Type | `@type {type}` |
|
|
179
|
+
| `@typedef` | Type definition | `@typedef {type} Name` |
|
|
180
|
+
| `@variation` | Variation | `@variation number` |
|
|
181
|
+
| `@version` | Version | `@version number` |
|
|
182
|
+
| `@yields` | Generator yield | `@yields {type} desc` |
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Inline Tags
|
|
187
|
+
|
|
188
|
+
Used within descriptions, enclosed in `{}`:
|
|
189
|
+
|
|
190
|
+
| Tag | Description | Syntax |
|
|
191
|
+
| -------------- | ------------------- | ---------------------------------------------- |
|
|
192
|
+
| `{@link}` | Link to symbol | `{@link namepath}` or `{@link namepath\|text}` |
|
|
193
|
+
| `{@linkcode}` | Code-formatted link | `{@linkcode namepath}` |
|
|
194
|
+
| `{@linkplain}` | Plain text link | `{@linkplain namepath}` |
|
|
195
|
+
| `{@tutorial}` | Tutorial link | `{@tutorial tutorialId}` |
|
|
196
|
+
|
|
197
|
+
**Escape braces**: `{@link method\|text with \} brace}`
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Type Expressions
|
|
202
|
+
|
|
203
|
+
### Basic Types
|
|
204
|
+
|
|
205
|
+
```javascript
|
|
206
|
+
{string} {number} {boolean} {Object}
|
|
207
|
+
{Array} {Function} {void} {undefined}
|
|
208
|
+
{null} {*} {any}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Modifiers
|
|
212
|
+
|
|
213
|
+
```javascript
|
|
214
|
+
{string[]} // Array of strings
|
|
215
|
+
{Array.<string>} // Array (alternative)
|
|
216
|
+
{Object.<string, number>} // Object with string keys, number values
|
|
217
|
+
{?string} // Nullable (string or null)
|
|
218
|
+
{!string} // Non-nullable
|
|
219
|
+
{string=} // Optional parameter
|
|
220
|
+
{...string} // Rest parameter
|
|
221
|
+
{(string|number)} // Union type
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Type Definitions
|
|
225
|
+
|
|
226
|
+
```javascript
|
|
227
|
+
/**
|
|
228
|
+
* @typedef {Object} User
|
|
229
|
+
* @property {string} name
|
|
230
|
+
* @property {number} age
|
|
231
|
+
* @property {string} [email] - Optional
|
|
232
|
+
*/
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* @callback RequestCallback
|
|
236
|
+
* @param {Error} error
|
|
237
|
+
* @param {Object} response
|
|
238
|
+
*/
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Namepaths
|
|
244
|
+
|
|
245
|
+
| Syntax | Description | Example |
|
|
246
|
+
| -------------------- | --------------- | ------------------------ |
|
|
247
|
+
| `name` | Global/function | `myFunction` |
|
|
248
|
+
| `Class#member` | Instance member | `MyClass#method` |
|
|
249
|
+
| `Class.member` | Static member | `MyClass.staticMethod` |
|
|
250
|
+
| `Class~member` | Inner member | `MyClass~privateFunc` |
|
|
251
|
+
| `module:name` | Module | `module:myModule` |
|
|
252
|
+
| `module:name#member` | Module instance | `module:myModule#method` |
|
|
253
|
+
| `external:name` | External | `external:String` |
|
|
254
|
+
| `event:name` | Event | `event:MyEvent` |
|
|
255
|
+
|
|
256
|
+
**Separators**:
|
|
257
|
+
|
|
258
|
+
- `#` — Instance (prototype)
|
|
259
|
+
- `.` — Static (class property)
|
|
260
|
+
- `~` — Inner (nested/private)
|
|
261
|
+
|
|
262
|
+
**Special characters**: Quote names with special chars: `chat."#channel".open`
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## Param Syntax
|
|
267
|
+
|
|
268
|
+
```javascript
|
|
269
|
+
/**
|
|
270
|
+
* @param {string} name - Required param
|
|
271
|
+
* @param {number} [age] - Optional param
|
|
272
|
+
* @param {number} [age=18] - Optional with default
|
|
273
|
+
* @param {Object} options - Object param
|
|
274
|
+
* @param {string} options.id - Object property
|
|
275
|
+
* @param {string} [options.name] - Optional property
|
|
276
|
+
* @param {...string} items - Rest param
|
|
277
|
+
*/
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Common Patterns
|
|
283
|
+
|
|
284
|
+
### Function
|
|
285
|
+
|
|
286
|
+
```javascript
|
|
287
|
+
/**
|
|
288
|
+
* Brief description.
|
|
289
|
+
* @param {string} name - The name
|
|
290
|
+
* @param {number} [age=0] - Optional age
|
|
291
|
+
* @returns {string} Greeting message
|
|
292
|
+
* @throws {TypeError} If name is not a string
|
|
293
|
+
* @example
|
|
294
|
+
* greet('Alice'); // "Hello, Alice!"
|
|
295
|
+
*/
|
|
296
|
+
function greet(name, age) {}
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### ES2015 Class
|
|
300
|
+
|
|
301
|
+
```javascript
|
|
302
|
+
/**
|
|
303
|
+
* Represents a point.
|
|
304
|
+
* @example
|
|
305
|
+
* const p = new Point(10, 20);
|
|
306
|
+
*/
|
|
307
|
+
class Point {
|
|
308
|
+
/**
|
|
309
|
+
* @param {number} x - X coordinate
|
|
310
|
+
* @param {number} y - Y coordinate
|
|
311
|
+
*/
|
|
312
|
+
constructor(x, y) {
|
|
313
|
+
/** @type {number} */
|
|
314
|
+
this.x = x;
|
|
315
|
+
/** @type {number} */
|
|
316
|
+
this.y = y;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Get distance to another point.
|
|
321
|
+
* @param {Point} other
|
|
322
|
+
* @returns {number}
|
|
323
|
+
*/
|
|
324
|
+
distanceTo(other) {}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Create from string.
|
|
328
|
+
* @param {string} str - Format: "x,y"
|
|
329
|
+
* @returns {Point}
|
|
330
|
+
* @static
|
|
331
|
+
*/
|
|
332
|
+
static fromString(str) {}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* @augments Point
|
|
337
|
+
*/
|
|
338
|
+
class Dot extends Point {
|
|
339
|
+
constructor(x, y, width) {
|
|
340
|
+
super(x, y);
|
|
341
|
+
/** @type {number} */
|
|
342
|
+
this.width = width;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### ES2015 Module
|
|
348
|
+
|
|
349
|
+
```javascript
|
|
350
|
+
/**
|
|
351
|
+
* @module color/mixer
|
|
352
|
+
*/
|
|
353
|
+
|
|
354
|
+
/** Module name constant. */
|
|
355
|
+
export const name = 'mixer';
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Blend two colors.
|
|
359
|
+
* @param {string} color1 - Hex color
|
|
360
|
+
* @param {string} color2 - Hex color
|
|
361
|
+
* @returns {string} Blended color
|
|
362
|
+
*/
|
|
363
|
+
export function blend(color1, color2) {}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* @default
|
|
367
|
+
* @class
|
|
368
|
+
*/
|
|
369
|
+
export default class Mixer {}
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### CommonJS Module
|
|
373
|
+
|
|
374
|
+
```javascript
|
|
375
|
+
/**
|
|
376
|
+
* @module my/utils
|
|
377
|
+
*/
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Format a date.
|
|
381
|
+
* @param {Date} date
|
|
382
|
+
* @returns {string}
|
|
383
|
+
*/
|
|
384
|
+
exports.formatDate = function (date) {};
|
|
385
|
+
|
|
386
|
+
// Or module.exports
|
|
387
|
+
module.exports = {
|
|
388
|
+
/**
|
|
389
|
+
* Parse input.
|
|
390
|
+
* @param {string} input
|
|
391
|
+
* @returns {Object}
|
|
392
|
+
*/
|
|
393
|
+
parse: function (input) {},
|
|
394
|
+
};
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### AMD Module
|
|
398
|
+
|
|
399
|
+
```javascript
|
|
400
|
+
/**
|
|
401
|
+
* @module my/shirt
|
|
402
|
+
*/
|
|
403
|
+
define('my/shirt', function () {
|
|
404
|
+
/**
|
|
405
|
+
* @exports my/shirt
|
|
406
|
+
*/
|
|
407
|
+
return {
|
|
408
|
+
/** @type {string} */
|
|
409
|
+
color: 'black',
|
|
410
|
+
|
|
411
|
+
/** Button the shirt. */
|
|
412
|
+
button: function () {},
|
|
413
|
+
};
|
|
414
|
+
});
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## Plugins
|
|
420
|
+
|
|
421
|
+
### Built-in Plugins
|
|
422
|
+
|
|
423
|
+
| Plugin | Description |
|
|
424
|
+
| ----------------------- | ------------------------------ |
|
|
425
|
+
| `plugins/markdown` | Parse Markdown in descriptions |
|
|
426
|
+
| `plugins/summarize` | Generate summaries |
|
|
427
|
+
| `plugins/tutorials` | Include tutorials |
|
|
428
|
+
| `plugins/escapeHtml` | Escape HTML (XSS prevention) |
|
|
429
|
+
| `plugins/comments-only` | Only files with JSDoc comments |
|
|
430
|
+
|
|
431
|
+
### Markdown Plugin Config
|
|
432
|
+
|
|
433
|
+
```json
|
|
434
|
+
{
|
|
435
|
+
"plugins": ["plugins/markdown"],
|
|
436
|
+
"markdown": {
|
|
437
|
+
"tags": ["@description", "@param", "@returns", "@throws", "@example"],
|
|
438
|
+
"excludeTags": ["@see"],
|
|
439
|
+
"hardwrap": false,
|
|
440
|
+
"idInHeadings": true
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
**Default processed tags**: `@author`, `@classdesc`, `@description`, `@param`,
|
|
446
|
+
`@property`, `@returns`, `@see`, `@throws`
|
|
447
|
+
|
|
448
|
+
### Tutorials
|
|
449
|
+
|
|
450
|
+
**Config**:
|
|
451
|
+
|
|
452
|
+
```json
|
|
453
|
+
{
|
|
454
|
+
"opts": { "tutorials": "tutorials/" }
|
|
455
|
+
}
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
**Hierarchy** (`tutorials/tutorials.json`):
|
|
459
|
+
|
|
460
|
+
```json
|
|
461
|
+
{
|
|
462
|
+
"getting-started": {
|
|
463
|
+
"title": "Getting Started",
|
|
464
|
+
"children": {
|
|
465
|
+
"installation": { "title": "Installation" },
|
|
466
|
+
"quick-start": { "title": "Quick Start" }
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
**Supported formats**: `.md`, `.markdown`, `.html`, `.htm`, `.xhtml`, `.xml`
|
|
473
|
+
|
|
474
|
+
**Link in code**:
|
|
475
|
+
|
|
476
|
+
```javascript
|
|
477
|
+
/**
|
|
478
|
+
* @tutorial getting-started
|
|
479
|
+
* See {@tutorial installation} for setup.
|
|
480
|
+
*/
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
---
|
|
484
|
+
|
|
485
|
+
## Custom Plugins
|
|
486
|
+
|
|
487
|
+
### Structure
|
|
488
|
+
|
|
489
|
+
```javascript
|
|
490
|
+
exports.handlers = {
|
|
491
|
+
parseBegin: function (e) {}, // e.sourcefiles
|
|
492
|
+
fileBegin: function (e) {}, // e.filename
|
|
493
|
+
beforeParse: function (e) {}, // e.filename, e.source (modifiable)
|
|
494
|
+
jsdocCommentFound: function (e) {}, // e.comment, e.filename
|
|
495
|
+
symbolFound: function (e) {}, // e.code, e.filename
|
|
496
|
+
newDoclet: function (e) {}, // e.doclet
|
|
497
|
+
fileComplete: function (e) {}, // e.filename, e.source
|
|
498
|
+
parseComplete: function (e) {}, // e.doclets (array)
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
exports.astNodeVisitor = {
|
|
502
|
+
visitNode: function (node, e, parser, currentSourceName) {},
|
|
503
|
+
};
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
### Plugin Events
|
|
507
|
+
|
|
508
|
+
| Event | Properties | Description |
|
|
509
|
+
| ------------------- | ------------------------- | ----------------------------------------- |
|
|
510
|
+
| `parseBegin` | `e.sourcefiles` | Before parsing starts |
|
|
511
|
+
| `fileBegin` | `e.filename` | Start parsing file |
|
|
512
|
+
| `beforeParse` | `e.filename`, `e.source` | Before content parsed (source modifiable) |
|
|
513
|
+
| `jsdocCommentFound` | `e.comment`, `e.filename` | JSDoc comment found |
|
|
514
|
+
| `symbolFound` | `e.code`, `e.filename` | Symbol identified |
|
|
515
|
+
| `newDoclet` | `e.doclet` | Doclet created |
|
|
516
|
+
| `fileComplete` | `e.filename`, `e.source` | File parsing complete |
|
|
517
|
+
| `parseComplete` | `e.doclets` | All parsing complete |
|
|
518
|
+
|
|
519
|
+
### Example Plugin
|
|
520
|
+
|
|
521
|
+
```javascript
|
|
522
|
+
var env = require('jsdoc/env');
|
|
523
|
+
|
|
524
|
+
exports.handlers = {
|
|
525
|
+
parseBegin: function (e) {
|
|
526
|
+
var config = env.conf.myplugin || {};
|
|
527
|
+
this.startTime = Date.now();
|
|
528
|
+
},
|
|
529
|
+
|
|
530
|
+
newDoclet: function (e) {
|
|
531
|
+
if (e.doclet.kind === 'function') {
|
|
532
|
+
e.doclet.customProp = 'processed';
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
|
|
536
|
+
parseComplete: function (e) {
|
|
537
|
+
console.log('Done in ' + (Date.now() - this.startTime) + 'ms');
|
|
538
|
+
},
|
|
539
|
+
};
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
---
|
|
543
|
+
|
|
544
|
+
## Templates
|
|
545
|
+
|
|
546
|
+
### Default Template Config
|
|
547
|
+
|
|
548
|
+
```json
|
|
549
|
+
{
|
|
550
|
+
"templates": {
|
|
551
|
+
"cleverLinks": true,
|
|
552
|
+
"monospaceLinks": false,
|
|
553
|
+
"useShortNamesInLinks": false,
|
|
554
|
+
"default": {
|
|
555
|
+
"outputSourceFiles": true,
|
|
556
|
+
"staticFiles": {
|
|
557
|
+
"include": [],
|
|
558
|
+
"exclude": []
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
### Popular Templates
|
|
566
|
+
|
|
567
|
+
- **docdash** — Clean, responsive
|
|
568
|
+
- **minami** — Minimal
|
|
569
|
+
- **DocStrap** — Bootstrap 3
|
|
570
|
+
- **better-docs** — Component support
|
|
571
|
+
|
|
572
|
+
```bash
|
|
573
|
+
jsdoc file.js -t node_modules/docdash
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
---
|
|
577
|
+
|
|
578
|
+
## Package Structure (Monorepo)
|
|
579
|
+
|
|
580
|
+
| Package | Description |
|
|
581
|
+
| --------------- | ------------------------------- |
|
|
582
|
+
| `@jsdoc/cli` | CLI |
|
|
583
|
+
| `@jsdoc/core` | Core functionality |
|
|
584
|
+
| `@jsdoc/parse` | Parsing |
|
|
585
|
+
| `@jsdoc/tag` | Tag definitions |
|
|
586
|
+
| `@jsdoc/ast` | AST utilities |
|
|
587
|
+
| `@jsdoc/doclet` | Doclet management |
|
|
588
|
+
| `@jsdoc/salty` | Data storage (replaces taffydb) |
|
|
589
|
+
|
|
590
|
+
---
|
|
591
|
+
|
|
592
|
+
## Best Practices
|
|
593
|
+
|
|
594
|
+
1. **Place comments immediately before code**
|
|
595
|
+
2. **First line = brief summary**
|
|
596
|
+
3. **Tag order**: description → `@param` → `@returns` → `@throws` → `@example`
|
|
597
|
+
4. **Document all public APIs**
|
|
598
|
+
5. **Use type annotations**
|
|
599
|
+
6. **Include examples for complex functions**
|
|
600
|
+
7. **Use `[name]` for optional params, `[name=default]` for defaults**
|
|
601
|
+
8. **Use namepaths correctly**: `#` instance, `.` static, `~` inner
|
|
602
|
+
9. **Enable Markdown plugin for rich formatting**
|
|
603
|
+
10. **Link related symbols with `@see` and `{@link}`**
|
|
604
|
+
|
|
605
|
+
---
|
|
606
|
+
|
|
607
|
+
## Notes
|
|
608
|
+
|
|
609
|
+
- Comments must use `/**` (not `/*` or `//`)
|
|
610
|
+
- Tag names are case-sensitive
|
|
611
|
+
- Multiple same-type tags allowed (e.g., multiple `@param`)
|
|
612
|
+
- JSDoc 4.0.0+ uses semantic versioning
|
|
613
|
+
- `@jsdoc/salty` replaces `taffydb` in JSDoc 4.0.0+
|
|
614
|
+
|
|
615
|
+
---
|
|
616
|
+
|
|
617
|
+
## Resources
|
|
618
|
+
|
|
619
|
+
- **Website**: https://jsdoc.app/
|
|
620
|
+
- **GitHub**: https://github.com/jsdoc/jsdoc
|
|
621
|
+
- **Playground**: https://jsdoc.app/about-commandline.html
|