0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/tools/doc
Vse Mozhet Byt e6b7f0ef0c tools, doc: wrap manpage links in code elements
PR-URL: https://github.com/nodejs/node/pull/20785
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-05-17 23:31:50 +03:00
..
node_modules/marked tools: eliminate intermediate module in doctools 2018-05-16 18:44:54 +03:00
addon-verify.js tools: modernize and optimize doc/addon-verify.js 2018-04-24 10:30:21 +03:00
common.js tools: eliminate intermediate module in doctools 2018-05-16 18:44:54 +03:00
generate.js tools: simplify HTML generation 2018-04-28 00:52:25 +03:00
html.js tools, doc: wrap manpage links in code elements 2018-05-17 23:31:50 +03:00
json.js tools: improve heading type detection in json.js 2018-04-22 18:09:37 +03:00
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 redundant RegExp flag 2018-04-28 05:08:44 +03:00
README.md doc: update tools/doc/README.md 2018-04-16 14:07:40 +03:00
type-parser.js tools: dedupe property access in doc/type-parser 2018-05-02 05:50:01 +03: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. **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).