0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 15:30:56 +01:00
nodejs/tools/doc
Sebastiaan Deckers bb29405904
lib,src: fix consistent spacing inside braces
PR-URL: https://github.com/nodejs/node/pull/14162
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-21 15:13:47 -04:00
..
node_modules
addon-verify.js tools: generate template literal for addon tests 2017-07-07 15:22:35 -07:00
common.js tools,doc: enable changelogs for items 2017-02-24 02:06:31 +01:00
generate.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
html.js tools: change var to const in ./doc/html 2017-07-02 19:26:41 -04:00
json.js lib,src: fix consistent spacing inside braces 2017-07-21 15:13:47 -04:00
LICENSE
package.json tools: update package.json engine field 2017-07-14 13:49:22 -07:00
preprocess.js tools: change var to const in ./doc/preprocess 2017-07-02 19:26:57 -04:00
README.md doc: remove duplicate properties bullet in readme 2017-01-13 09:53:53 -08:00
type-parser.js doc/tools: fix more type inconsistencies 2017-03-08 17:19:24 +01: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)