node/tools/doc
Timothy Gu 8653c42a41
doc: rename HTTP2 to HTTP/2
Previously, "HTTP/2" was strictly used to describe the protocol, and
HTTP2 the module. This distinction is deemed unnecessary, and
consistency between the two terms is enforced.

PR-URL: https://github.com/nodejs/node/pull/19603
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Chen Gang <gangc.cxy@foxmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
2018-03-27 16:09:39 +02:00
..
node_modules tools: move eslint from tools to tools/node_modules 2018-01-24 07:47:28 -06:00
addon-verify.js
common.js tools: fix nits in tools/doc/common.js 2018-03-27 16:06:10 +02:00
generate.js tools: fix logic nit in tools/doc/generate.js 2018-03-22 16:41:04 +00:00
html.js tools: fix man pages linking regex 2018-01-09 04:32:31 -05:00
json.js tools: replace string concatenation with template literals 2017-11-06 17:49:31 -05:00
LICENSE
package-lock.json tools: fix gitignore for tools/doc/ 2017-12-12 03:27:28 -05:00
package.json tools: fix gitignore for tools/doc/ 2017-12-12 03:27:28 -05:00
preprocess.js tools: simplify tools/doc/preprocess.js 2018-03-27 16:06:16 +02:00
README.md doc: fix nits in tools/doc/README.md 2018-02-21 18:12:40 -05:00
type-parser.js doc: rename HTTP2 to HTTP/2 2018-03-27 16:09:39 +02:00

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.

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.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 arguments, description).
  • Functions have (list of arguments, description).
  • Methods have (list of arguments, description).
  • Modules have (description, Properties, Functions, Classes, Examples).
  • Properties have (type, description).