node/tools/doc
Timothy Gu 0e2aba96bc doc/json: make sure links are correctly passed to marked
Previously, an attempt was made to make sure the links state is
inherited. Unfortunately, this support was not complete, which
results in various unresolved links in the JSON output (as an
example, [1] contains `initialized by calling
[<code>buf.fill(fill, encoding)</code>][<code>buf.fill()</code>]`).

This commit completes that attempt. After this commit, individual
instances of the parser (for descriptions) inherit the links state
from the root lexer, so that individual Markdown links in descriptions
could be resolved. That same example is now substituted with
`initialized by calling <a href=\"#buffer_buf_fill_value_offset_end_encoding\"><code>buf.fill(fill, encoding)</code></a>`.

[1]: https://nodejs.org/api/buffer.json

PR-URL: https://github.com/nodejs/node/pull/8494
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-10-26 14:09:23 -04:00
..
node_modules tools: update marked dependency 2016-07-14 12:45:19 -07:00
addon-verify.js tools: fix tools/doc/addon-verify.js regression 2016-07-14 12:45:20 -07:00
common.js tools: allow multiple added: version entries 2016-07-14 12:45:19 -07:00
generate.js tools: restore change of signatures to opts hashes 2016-07-14 12:45:21 -07:00
html.js doc: use blockquotes for Stability: markers 2016-10-26 14:09:04 -04:00
json.js doc/json: make sure links are correctly passed to marked 2016-10-26 14:09:23 -04:00
LICENSE Mention marked, and add license to doc generator 2012-03-05 10:59:14 -08:00
package.json tools: update marked dependency 2016-07-14 12:45:19 -07:00
preprocess.js tools: make sure doctool anchors respect includes 2016-07-14 12:45:21 -07:00
README.md doc: use blockquotes for Stability: markers 2016-10-26 14:09:04 -04:00
type-parser.js lib,test,tools: alignment on variable assignments 2016-06-23 16:59:37 -07: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.
  • Modules have (description, Properties, Functions, Classes, Examples)
  • Properties have (type, description)
  • Functions have (list of arguments, description)
  • Classes have (description, Properties, Methods, Events)
  • Events have (list of arguments, description)
  • Methods have (list of arguments, description)
  • Properties have (type, description)