node/tools/doc
Vse Mozhet Byt bc2f0a5120
doc: linkify missing types
Also, alphabetize all types in type-parser.js
and fix some nits in type formats.

Backport-PR-URL: https://github.com/nodejs/node/pull/19500
PR-URL: https://github.com/nodejs/node/pull/18444
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-29 23:25:37 -04:00
..
node_modules tools: update marked dependency 2016-05-17 08:15:10 -05:00
addon-verify.js tools: fix tools/addon-verify.js 2017-09-19 14:26:58 -04:00
common.js tools: allow multiple added: version entries 2016-05-17 08:15:05 -05:00
generate.js tools: make doc tool a bit more readable 2018-01-02 14:06:34 -05:00
html.js tools: make doc tool a bit more readable 2018-01-02 14:06:34 -05:00
json.js tools: replace string concatenation with template literals 2017-11-28 13:10:56 +09:00
LICENSE
package.json tools: update package.json engine field 2017-09-05 12:49:54 -04:00
preprocess.js tools: remove useless function declaration 2018-01-02 14:06:34 -05:00
README.md doc: remove duplicate properties bullet in readme 2017-03-08 17:11:01 -08:00
type-parser.js doc: linkify missing types 2018-03-29 23:25:37 -04: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
<!-- YAML
added: v0.10.0
-->

> Stability: 3 - Stable

description and examples.

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

* Type

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
-->

* Argument: SomeClass object.

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

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

description of the class.

### Class Method: 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`.
* Return: {Boolean} `true` if it worked.

Description of the method for humans.

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

* Return: {SomeClass object | 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)