0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/tools/doc
Ben Noordhuis 2cb9e2a6f7
build,tools: check freshness of doc addons
Add a `--check` flag to `tools/doc/addon-verify.js` and use that in the
`make test` target to determine if the generated files in `test/addons`
are fresh or stale.

PR-URL: https://github.com/nodejs/node/pull/17407
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-01-21 02:19:47 +01:00
..
node_modules tools: move eslint from tools to tools/node_modules 2018-01-11 09:48:05 +01:00
addon-verify.js build,tools: check freshness of doc addons 2018-01-21 02:19:47 +01:00
common.js
generate.js tools: make doc tool a bit more readable 2017-11-21 10:07:05 +01:00
html.js tools: fix man pages linking regex 2017-12-22 17:25:26 -05:00
json.js
LICENSE
package-lock.json tools: fix gitignore for tools/doc/ 2017-11-24 10:24:37 -05:00
package.json tools: fix gitignore for tools/doc/ 2017-11-24 10:24:37 -05:00
preprocess.js tools: remove useless function declaration 2017-11-21 10:06:51 +01:00
README.md
type-parser.js doc,test: mention Duplex support for TLS 2017-12-12 12:46:21 -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
<!-- 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)