nodejs/tools/doc
Jérémy Lal 5b0d2b1398 build doc using marked and js-yaml
While waiting for unified/remarked/rehyped modules to be available in debian
Forwarded: not-needed
Reviewed-By: Xavier Guimard <yadd@debian.org>
Last-Update: 2022-01-27

Gbp-Pq: Name make-doc.patch
2022-08-16 11:14:23 +08:00
..
LICENSE Import Upstream version 12.22.9~dfsg 2022-08-16 11:12:47 +08:00
README.md Import Upstream version 12.22.9~dfsg 2022-08-16 11:12:47 +08:00
addon-verify.js build doc using marked and js-yaml 2022-08-16 11:14:23 +08:00
allhtml.js build doc using marked and js-yaml 2022-08-16 11:14:23 +08:00
alljson.js Import Upstream version 12.22.9~dfsg 2022-08-16 11:12:47 +08:00
apilinks.js Import Upstream version 12.22.9~dfsg 2022-08-16 11:12:47 +08:00
checkLinks.js Import Upstream version 12.22.9~dfsg 2022-08-16 11:12:47 +08:00
common.js build doc using marked and js-yaml 2022-08-16 11:14:23 +08:00
generate.js build doc using marked and js-yaml 2022-08-16 11:14:23 +08:00
html.js build doc using marked and js-yaml 2022-08-16 11:14:23 +08:00
json.js build doc using marked and js-yaml 2022-08-16 11:14:23 +08:00
links-mapper.json Import Upstream version 12.22.9~dfsg 2022-08-16 11:12:47 +08:00
markdown.js Import Upstream version 12.22.9~dfsg 2022-08-16 11:12:47 +08:00
package-lock.json Import Upstream version 12.22.9~dfsg 2022-08-16 11:12:47 +08:00
package.json Import Upstream version 12.22.9~dfsg 2022-08-16 11:12:47 +08:00
type-parser.js build doc using marked and js-yaml 2022-08-16 11:14:23 +08:00
versions.js build doc using marked and js-yaml 2022-08-16 11:14:23 +08:00

README.md

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