node/tools/doc
Antoine du Hamel 634a6b3a14
doc: improve accessibility of expandable lists
PR-URL: https://github.com/nodejs/node/pull/56749
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
2025-02-10 19:34:10 +01:00
..
addon-verify.mjs tools: prepare tools/doc for to-vfile 8.0.0 2023-09-12 10:58:28 -04:00
allhtml.mjs doc: add main ARIA landmark to API docs 2025-02-10 19:32:46 +01:00
alljson.mjs tools: enforce use of trailing commas in tools/ 2023-01-24 16:38:14 -05:00
apilinks.mjs tools: enforce use of trailing commas in tools/ 2023-01-24 16:38:14 -05:00
buildCSSForFlavoredJS.mjs doc: rename possibly confusing variable and CSS class 2025-02-10 19:32:57 +01:00
common.mjs
deprecationCodes.mjs tools: enforce use of trailing commas in tools/ 2023-01-24 16:38:14 -05:00
deps.mjs
generate.mjs
html.mjs doc: improve accessibility of expandable lists 2025-02-10 19:34:10 +01:00
json.mjs tools: enforce use of trailing commas in tools/ 2023-01-24 16:38:14 -05:00
LICENSE
links-mapper.json
markdown.mjs tools: enforce use of trailing commas in tools/ 2023-01-24 16:38:14 -05:00
package-lock.json tools: update doc to unist-util-select@5.0.0 unist-util-visit@5.0.0 2023-09-16 15:39:16 -04:00
package.json tools: update doc to unist-util-select@5.0.0 unist-util-visit@5.0.0 2023-09-16 15:39:16 -04:00
README.md
stability.mjs tools: fix stability index generation 2023-01-03 08:38:37 -05:00
type-parser.mjs lib: add tracing channel to diagnostics_channel 2023-11-10 15:50:54 +01:00
versions.mjs

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