0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-25 08:19:38 +01:00
nodejs/tools/doc
Michaël Zasso 8dbeac6c04 tools: update doc tool dependencies
PR-URL: https://github.com/nodejs/node/pull/36407
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-08 22:17:58 +00:00
..
addon-verify.js tools: update doc tools to remark-parse@9.0.0 2020-11-12 06:29:51 +00:00
allhtml.js
alljson.js
apilinks.js tools,doc: enable ecmaVersion 2021 in acorn parser 2020-11-07 01:30:21 +00:00
checkLinks.js tools: update doc tools to remark-parse@9.0.0 2020-11-12 06:29:51 +00:00
common.js
generate.js tools: update doc tools to remark-parse@9.0.0 2020-11-12 06:29:51 +00:00
html.js tools: update stability index linking logic 2020-11-30 16:57:48 -08:00
json.js
LICENSE
links-mapper.json
markdown.js
package-lock.json tools: update doc tool dependencies 2020-12-08 22:17:58 +00:00
package.json tools: update doc tool dependencies 2020-12-08 22:17:58 +00:00
README.md
type-parser.js worker: add experimental BroadcastChannel 2020-12-01 08:02:28 -08:00
versions.js

Here's how the node docs work.

1:1 relationship from lib/<module>.js to doc/api/<module>.md.

Each type of heading has a description block.

# module

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

A description and examples.

## module.property
<!-- YAML
added: v0.10.0
-->

* {type}

A description of the property.

## module.someFunction(x, y, [z=100])
<!-- YAML
added: v0.10.0
-->

* `x` {string} The description of the string.
* `y` {boolean} Should I stay or should I go?
* `z` {number} How many zebras to bring. **Default:** `100`.

A description of the function.

## module.someNewFunction(x)
<!-- YAML
added: REPLACEME
-->

* `x` {string} The description of the string.

This feature is not in a release yet.

## Event: 'blerg'
<!-- YAML
added: v0.10.0
-->

* `anArg` {type} A description of the listener argument.

Modules don't usually raise events on themselves. `cluster` is the
only exception.

## Class: SomeClass
<!-- YAML
added: v0.10.0
-->

A description of the class.

### SomeClass.classMethod(anArg)
<!-- YAML
added: v0.10.0
-->

* `anArg` {Object} Just an argument.
  * `field` {string} `anArg` can have this field.
  * `field2` {boolean} Another field. **Default:** `false`.
* Returns: {boolean} `true` if it worked.

A description of the method for humans.

### SomeClass.nextSibling()
<!-- YAML
added: v0.10.0
-->

* Returns: {SomeClass | null} The next `SomeClass` in line.

`SomeClass` must be registered in `tools/doc/type-parser.js`
to be properly parsed in `{type}` fields.

### SomeClass.someProperty
<!-- YAML
added: v0.10.0
-->

* {string}

The indication of what `someProperty` is.

### Event: 'grelb'
<!-- YAML
added: v0.10.0
-->

* `isBlerg` {boolean}

This event is emitted on instances of `SomeClass`, not on the module itself.
  • Classes have (description, Properties, Methods, Events).
  • 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).
  • Modules have (description, Properties, Functions, Classes, Examples).
  • Properties have (type, description).