2012-02-27 19:59:01 +01:00
|
|
|
Here's how the node docs work.
|
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
1:1 relationship from `lib/<module>.js` to `doc/api/<module>.md`.
|
2012-02-27 19:59:01 +01:00
|
|
|
|
|
|
|
Each type of heading has a description block.
|
|
|
|
|
2016-09-20 06:44:22 +02:00
|
|
|
```md
|
2018-02-20 00:26:58 +01:00
|
|
|
# module
|
|
|
|
|
|
|
|
<!--introduced_in=v0.10.0-->
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
> Stability: 2 - Stable
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
A description and examples.
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
## module.property
|
2016-09-20 06:44:22 +02:00
|
|
|
<!-- YAML
|
|
|
|
added: v0.10.0
|
|
|
|
-->
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
* {type}
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
A description of the property.
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
## module.someFunction(x, y, [z=100])
|
2016-09-20 06:44:22 +02:00
|
|
|
<!-- YAML
|
|
|
|
added: v0.10.0
|
|
|
|
-->
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
* `x` {string} The description of the string.
|
|
|
|
* `y` {boolean} Should I stay or should I go?
|
2018-04-15 15:56:12 +02:00
|
|
|
* `z` {number} How many zebras to bring. **Default:** `100`.
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2016-09-20 06:44:22 +02:00
|
|
|
A description of the function.
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
## module.someNewFunction(x)
|
2016-09-20 06:44:22 +02:00
|
|
|
<!-- YAML
|
|
|
|
added: REPLACEME
|
|
|
|
-->
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
* `x` {string} The description of the string.
|
2016-05-19 11:11:51 +02:00
|
|
|
|
2016-09-20 06:44:22 +02:00
|
|
|
This feature is not in a release yet.
|
2016-05-19 11:11:51 +02:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
## Event: 'blerg'
|
2016-09-20 06:44:22 +02:00
|
|
|
<!-- YAML
|
|
|
|
added: v0.10.0
|
|
|
|
-->
|
2016-05-19 11:11:51 +02:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
* `anArg` {type} A description of the listener argument.
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
Modules don't usually raise events on themselves. `cluster` is the
|
2016-09-20 06:44:22 +02:00
|
|
|
only exception.
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2016-09-20 06:44:22 +02:00
|
|
|
## Class: SomeClass
|
|
|
|
<!-- YAML
|
|
|
|
added: v0.10.0
|
|
|
|
-->
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
A description of the class.
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
### SomeClass.classMethod(anArg)
|
2016-09-20 06:44:22 +02:00
|
|
|
<!-- YAML
|
|
|
|
added: v0.10.0
|
|
|
|
-->
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
* `anArg` {Object} Just an argument.
|
|
|
|
* `field` {string} `anArg` can have this field.
|
2018-04-15 15:56:12 +02:00
|
|
|
* `field2` {boolean} Another field. **Default:** `false`.
|
2018-02-20 00:26:58 +01:00
|
|
|
* Returns: {boolean} `true` if it worked.
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
A description of the method for humans.
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
### SomeClass.nextSibling()
|
2016-09-20 06:44:22 +02:00
|
|
|
<!-- YAML
|
|
|
|
added: v0.10.0
|
|
|
|
-->
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
* Returns: {SomeClass | null} The next `SomeClass` in line.
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-04-15 15:56:12 +02:00
|
|
|
`SomeClass` must be registered in `tools/doc/type-parser.js`
|
|
|
|
to be properly parsed in `{type}` fields.
|
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
### SomeClass.someProperty
|
2016-09-20 06:44:22 +02:00
|
|
|
<!-- YAML
|
|
|
|
added: v0.10.0
|
|
|
|
-->
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
* {string}
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
The indication of what `someProperty` is.
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2016-09-20 06:44:22 +02:00
|
|
|
### Event: 'grelb'
|
|
|
|
<!-- YAML
|
|
|
|
added: v0.10.0
|
|
|
|
-->
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
* `isBlerg` {boolean}
|
2012-02-27 19:59:01 +01:00
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
This event is emitted on instances of `SomeClass`, not on the module itself.
|
2016-09-20 06:44:22 +02:00
|
|
|
```
|
2012-02-27 19:59:01 +01:00
|
|
|
|
|
|
|
|
2018-02-20 00:26:58 +01:00
|
|
|
* Classes have (description, Properties, Methods, Events).
|
2018-04-15 15:56:12 +02:00
|
|
|
* Events have (list of listener arguments, description).
|
|
|
|
* Functions have (list of arguments, returned value if defined, description).
|
|
|
|
* Methods have (list of arguments, returned value if defined, description).
|
2018-02-20 00:26:58 +01:00
|
|
|
* Modules have (description, Properties, Functions, Classes, Examples).
|
|
|
|
* Properties have (type, description).
|