node/tools/doc
Marek Łabuz 62c61b754d
tools: add unified plugin changing links for html docs
This commit introduces additional stage in the process of generating
html docs from markdown files. Plugin transforms links to *.md files
in the respository to links to *.html files in the online documentation.

Fixes: https://github.com/nodejs/node/issues/28689

PR-URL: https://github.com/nodejs/node/pull/29946
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-11-30 18:17:56 +01:00
..
addon-verify.js tools: refactor tools JS code 2019-03-04 11:06:23 -08:00
allhtml.js tools: validate apidoc links 2018-07-22 19:33:55 +03:00
alljson.js tools: build all.json by combining generated JSON 2018-07-09 22:57:33 +03:00
apilinks.js tools: switch to camelcasing in apilinks.js 2019-05-09 21:41:03 -07:00
common.js tools: fix doc tool behavior for version arrays 2018-09-12 11:47:08 +02:00
generate.js tools: add unified plugin changing links for html docs 2019-11-30 18:17:56 +01:00
html.js test: fix flaky doctool and test 2019-10-15 13:22:41 -07:00
json.js tools: produce JSON documentation using unified/remark/rehype 2018-07-25 21:33:06 +03:00
LICENSE
links-mapper.json tools: add unified plugin changing links for html docs 2019-11-30 18:17:56 +01:00
markdown.js tools: add unified plugin changing links for html docs 2019-11-30 18:17:56 +01:00
package-lock.json tools: update dependencies in tools/doc 2019-05-27 13:35:22 -07:00
package.json tools: doc: improve async workflow of generate.js 2019-10-27 10:08:22 +01:00
README.md doc: prepare markdown files for more stringent blank-line linting 2019-09-07 07:07:25 -07:00
type-parser.js wasi: introduce initial WASI support 2019-11-30 18:06:39 +01:00
versions.js tools: make doctool work if no internet available 2019-11-05 22:10:33 -05: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).