Skip to content

Commit

Permalink
doc: update list styles for remark-parse@9 rendering
Browse files Browse the repository at this point in the history
remark-parse@9.0.0 combined with our html.js tool ends a list if a
multi-line item does not include indentation. Update our docs for this
formatting.

I looked around for a lint rule to enforce this but didn't find one
readily available. (Happy to be shown that I'm wrong about that!) We may
need to write one.

PR-URL: #36049
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
  • Loading branch information
Trott authored and BethGriggs committed Dec 10, 2020
1 parent 39c60d4 commit 168f346
Show file tree
Hide file tree
Showing 16 changed files with 108 additions and 107 deletions.
31 changes: 16 additions & 15 deletions doc/api/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,26 @@ they were created.
The context-aware addon can be structured to avoid global static data by
performing the following steps:
* Define a class which will hold per-addon-instance data and which has a static
member of the form
member of the form
```cpp
static void DeleteInstance(void* data) {
// Cast `data` to an instance of the class and delete it.
}
```
* Heap-allocate an instance of this class in the addon initializer. This can be
accomplished using the `new` keyword.
accomplished using the `new` keyword.
* Call `node::AddEnvironmentCleanupHook()`, passing it the above-created
instance and a pointer to `DeleteInstance()`. This will ensure the instance is
deleted when the environment is torn down.
instance and a pointer to `DeleteInstance()`. This will ensure the instance is
deleted when the environment is torn down.
* Store the instance of the class in a `v8::External`, and
* Pass the `v8::External` to all methods exposed to JavaScript by passing it
to `v8::FunctionTemplate::New()` or `v8::Function::New()` which creates the
native-backed JavaScript functions. The third parameter of
`v8::FunctionTemplate::New()` or `v8::Function::New()` accepts the
`v8::External` and makes it available in the native callback using the
`v8::FunctionCallbackInfo::Data()` method.
to `v8::FunctionTemplate::New()` or `v8::Function::New()` which creates the
native-backed JavaScript functions. The third parameter of
`v8::FunctionTemplate::New()` or `v8::Function::New()` accepts the
`v8::External` and makes it available in the native callback using the
`v8::FunctionCallbackInfo::Data()` method.

This will ensure that the per-addon-instance data reaches each binding that can
be called from JavaScript. The per-addon-instance data must also be passed into
Expand Down Expand Up @@ -395,14 +396,14 @@ the appropriate headers automatically. However, there are a few caveats to be
aware of:

* When `node-gyp` runs, it will detect the specific release version of Node.js
and download either the full source tarball or just the headers. If the full
source is downloaded, addons will have complete access to the full set of
Node.js dependencies. However, if only the Node.js headers are downloaded, then
only the symbols exported by Node.js will be available.
and download either the full source tarball or just the headers. If the full
source is downloaded, addons will have complete access to the full set of
Node.js dependencies. However, if only the Node.js headers are downloaded,
then only the symbols exported by Node.js will be available.

* `node-gyp` can be run using the `--nodedir` flag pointing at a local Node.js
source image. Using this option, the addon will have access to the full set of
dependencies.
source image. Using this option, the addon will have access to the full set of
dependencies.

### Loading addons using `require()`

Expand Down
2 changes: 1 addition & 1 deletion doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ added: v14.2.0
-->

* Returns: {Array} of objects containing information about the wrapper functions
returned by [`tracker.calls()`][].
returned by [`tracker.calls()`][].
* Object {Object}
* `message` {string}
* `actual` {number} The actual number of times the function was called.
Expand Down
16 changes: 8 additions & 8 deletions doc/api/async_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -697,14 +697,14 @@ asyncResource.triggerAsyncId();
* `type` {string} The type of async event.
* `options` {Object}
* `triggerAsyncId` {number} The ID of the execution context that created this
async event. **Default:** `executionAsyncId()`.
async event. **Default:** `executionAsyncId()`.
* `requireManualDestroy` {boolean} If set to `true`, disables `emitDestroy`
when the object is garbage collected. This usually does not need to be set
(even if `emitDestroy` is called manually), unless the resource's `asyncId`
is retrieved and the sensitive API's `emitDestroy` is called with it.
When set to `false`, the `emitDestroy` call on garbage collection
will only take place if there is at least one active `destroy` hook.
**Default:** `false`.
when the object is garbage collected. This usually does not need to be set
(even if `emitDestroy` is called manually), unless the resource's `asyncId`
is retrieved and the sensitive API's `emitDestroy` is called with it.
When set to `false`, the `emitDestroy` call on garbage collection
will only take place if there is at least one active `destroy` hook.
**Default:** `false`.

Example usage:

Expand Down Expand Up @@ -785,7 +785,7 @@ never be called.
#### `asyncResource.triggerAsyncId()`

* Returns: {number} The same `triggerAsyncId` that is passed to the
`AsyncResource` constructor.
`AsyncResource` constructor.

<a id="async-resource-worker-pool"></a>
### Using `AsyncResource` for a `Worker` thread pool
Expand Down
14 changes: 7 additions & 7 deletions doc/api/debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ To begin watching an expression, type `watch('my_expression')`. The command
* `setBreakpoint()`, `sb()`: Set breakpoint on current line
* `setBreakpoint(line)`, `sb(line)`: Set breakpoint on specific line
* `setBreakpoint('fn()')`, `sb(...)`: Set breakpoint on a first statement in
functions body
functions body
* `setBreakpoint('script.js', 1)`, `sb(...)`: Set breakpoint on first line of
`script.js`
`script.js`
* `setBreakpoint('script.js', 1, 'num < 4')`, `sb(...)`: Set conditional
breakpoint on first line of `script.js` that only breaks when `num < 4`
evaluates to `true`
breakpoint on first line of `script.js` that only breaks when `num < 4`
evaluates to `true`
* `clearBreakpoint('script.js', 1)`, `cb(...)`: Clear breakpoint in `script.js`
on line 1
on line 1

It is also possible to set a breakpoint in a file (module) that
is not loaded yet:
Expand Down Expand Up @@ -188,11 +188,11 @@ debug>

* `backtrace`, `bt`: Print backtrace of current execution frame
* `list(5)`: List scripts source code with 5 line context (5 lines before and
after)
after)
* `watch(expr)`: Add expression to watch list
* `unwatch(expr)`: Remove expression from watch list
* `watchers`: List all watchers and their values (automatically listed on each
breakpoint)
breakpoint)
* `repl`: Open debugger's repl for evaluation in debugging script's context
* `exec expr`: Execute an expression in debugging script's context

Expand Down
10 changes: 5 additions & 5 deletions doc/api/dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ changes:
The following flags can be passed as hints to [`dns.lookup()`][].

* `dns.ADDRCONFIG`: Limits returned address types to the types of non-loopback
addresses configured on the system. For example, IPv4 addresses are only
returned if the current system has at least one IPv4 address configured.
addresses configured on the system. For example, IPv4 addresses are only
returned if the current system has at least one IPv4 address configured.
* `dns.V4MAPPED`: If the IPv6 family was specified, but no IPv6 addresses were
found, then return IPv4 mapped IPv6 addresses. It is not supported
on some operating systems (e.g FreeBSD 10.1).
found, then return IPv4 mapped IPv6 addresses. It is not supported
on some operating systems (e.g FreeBSD 10.1).
* `dns.ALL`: If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as
well as IPv4 mapped IPv6 addresses.
well as IPv4 mapped IPv6 addresses.

## `dns.lookupService(address, port, callback)`
<!-- YAML
Expand Down
44 changes: 22 additions & 22 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1678,13 +1678,13 @@ OR of two or more values (e.g.
`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`).

* `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already
exists.
exists.
* `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a
copy-on-write reflink. If the platform does not support copy-on-write, then a
fallback copy mechanism is used.
copy-on-write reflink. If the platform does not support copy-on-write, then a
fallback copy mechanism is used.
* `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to
create a copy-on-write reflink. If the platform does not support copy-on-write,
then the operation will fail.
create a copy-on-write reflink. If the platform does not support
copy-on-write, then the operation will fail.

```js
const fs = require('fs');
Expand Down Expand Up @@ -1727,13 +1727,13 @@ OR of two or more values (e.g.
`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`).

* `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already
exists.
exists.
* `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a
copy-on-write reflink. If the platform does not support copy-on-write, then a
fallback copy mechanism is used.
copy-on-write reflink. If the platform does not support copy-on-write, then a
fallback copy mechanism is used.
* `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to
create a copy-on-write reflink. If the platform does not support copy-on-write,
then the operation will fail.
create a copy-on-write reflink. If the platform does not support
copy-on-write, then the operation will fail.

```js
const fs = require('fs');
Expand Down Expand Up @@ -1778,7 +1778,7 @@ changes:
* `path` {string|Buffer|URL}
* `options` {string|Object}
* `flags` {string} See [support of file system `flags`][]. **Default:**
`'r'`.
`'r'`.
* `encoding` {string} **Default:** `null`
* `fd` {integer} **Default:** `null`
* `mode` {integer} **Default:** `0o666`
Expand Down Expand Up @@ -1881,7 +1881,7 @@ changes:
* `path` {string|Buffer|URL}
* `options` {string|Object}
* `flags` {string} See [support of file system `flags`][]. **Default:**
`'w'`.
`'w'`.
* `encoding` {string} **Default:** `'utf8'`
* `fd` {integer} **Default:** `null`
* `mode` {integer} **Default:** `0o666`
Expand Down Expand Up @@ -3092,11 +3092,11 @@ when possible prefer streaming via `fs.createReadStream()`.

1. Any specified file descriptor has to support reading.
2. If a file descriptor is specified as the `path`, it will not be closed
automatically.
automatically.
3. The reading will begin at the current position. For example, if the file
already had `'Hello World`' and six bytes are read with the file descriptor,
the call to `fs.readFile()` with the same file descriptor, would give
`'World'`, rather than `'Hello World'`.
already had `'Hello World`' and six bytes are read with the file descriptor,
the call to `fs.readFile()` with the same file descriptor, would give
`'World'`, rather than `'Hello World'`.

## `fs.readFileSync(path[, options])`
<!-- YAML
Expand Down Expand Up @@ -5135,13 +5135,13 @@ OR of two or more values (e.g.
`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`).

* `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already
exists.
exists.
* `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a
copy-on-write reflink. If the platform does not support copy-on-write, then a
fallback copy mechanism is used.
copy-on-write reflink. If the platform does not support copy-on-write, then a
fallback copy mechanism is used.
* `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to
create a copy-on-write reflink. If the platform does not support copy-on-write,
then the operation will fail.
create a copy-on-write reflink. If the platform does not support
copy-on-write, then the operation will fail.

```js
const {
Expand Down Expand Up @@ -5987,7 +5987,7 @@ string.
* `'wx'`: Like `'w'` but fails if the path exists.

* `'w+'`: Open file for reading and writing.
The file is created (if it does not exist) or truncated (if it exists).
The file is created (if it does not exist) or truncated (if it exists).

* `'wx+'`: Like `'w+'` but fails if the path exists.

Expand Down
6 changes: 3 additions & 3 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -1984,9 +1984,9 @@ Duplicates in raw headers are handled in the following ways, depending on the
header name:

* Duplicates of `age`, `authorization`, `content-length`, `content-type`,
`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,
`last-modified`, `location`, `max-forwards`, `proxy-authorization`, `referer`,
`retry-after`, `server`, or `user-agent` are discarded.
`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,
`last-modified`, `location`, `max-forwards`, `proxy-authorization`, `referer`,
`retry-after`, `server`, or `user-agent` are discarded.
* `set-cookie` is always an array. Duplicates are added to the array.
* For duplicate `cookie` headers, the values are joined together with '; '.
* For all other headers, the values are joined together with ', '.
Expand Down
2 changes: 1 addition & 1 deletion doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ added: v8.4.0
* `err` {Error}
* `pushStream` {ServerHttp2Stream} The returned `pushStream` object.
* `headers` {HTTP/2 Headers Object} Headers object the `pushStream` was
initiated with.
initiated with.

Initiates a push stream. The callback is invoked with the new `Http2Stream`
instance created for the push stream passed as the second argument, or an
Expand Down
2 changes: 1 addition & 1 deletion doc/api/https.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ added: v0.3.4
-->

* `options` {Object} Accepts `options` from [`tls.createServer()`][],
[`tls.createSecureContext()`][] and [`http.createServer()`][].
[`tls.createSecureContext()`][] and [`http.createServer()`][].
* `requestListener` {Function} A listener to be added to the `'request'` event.
* Returns: {https.Server}

Expand Down
2 changes: 1 addition & 1 deletion doc/api/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ wrapper that looks like the following:
By doing this, Node.js achieves a few things:

* It keeps top-level variables (defined with `var`, `const` or `let`) scoped to
the module rather than the global object.
the module rather than the global object.
* It helps to provide some global-looking variables that are actually specific
to the module, such as:
* The `module` and `exports` objects that the implementor can use to export
Expand Down
20 changes: 10 additions & 10 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -858,8 +858,8 @@ typedef void (*napi_async_cleanup_hook)(napi_async_cleanup_hook_handle handle,
```

* `[in] handle`: The handle that must be passed to
[`napi_remove_async_cleanup_hook`][] after completion of the asynchronous
cleanup.
[`napi_remove_async_cleanup_hook`][] after completion of the asynchronous
cleanup.
* `[in] data`: The data that was passed to [`napi_add_async_cleanup_hook`][].

The body of the function should initiate the asynchronous cleanup actions at the
Expand Down Expand Up @@ -939,7 +939,7 @@ napi_get_last_error_info(napi_env env,

* `[in] env`: The environment that the API is invoked under.
* `[out] result`: The `napi_extended_error_info` structure with more
information about the error.
information about the error.

Returns `napi_ok` if the API succeeded.

Expand Down Expand Up @@ -1715,7 +1715,7 @@ NAPI_EXTERN napi_status napi_add_async_cleanup_hook(
* `[in] hook`: The function pointer to call at environment teardown.
* `[in] arg`: The pointer to pass to `hook` when it gets called.
* `[out] remove_handle`: Optional handle that refers to the asynchronous cleanup
hook.
hook.

Registers `hook`, which is a function of type [`napi_async_cleanup_hook`][], as
a function to be run with the `remove_handle` and `arg` parameters once the
Expand Down Expand Up @@ -1748,7 +1748,7 @@ NAPI_EXTERN napi_status napi_remove_async_cleanup_hook(
```

* `[in] remove_handle`: The handle to an asynchronous cleanup hook that was
created with [`napi_add_async_cleanup_hook`][].
created with [`napi_add_async_cleanup_hook`][].

Unregisters the cleanup hook corresponding to `remove_handle`. This will prevent
the hook from being executed, unless it has already started executing.
Expand Down Expand Up @@ -3355,7 +3355,7 @@ napi_status napi_typeof(napi_env env, napi_value value, napi_valuetype* result)
Returns `napi_ok` if the API succeeded.

* `napi_invalid_arg` if the type of `value` is not a known ECMAScript type and
`value` is not an External value.
`value` is not an External value.

This API represents behavior similar to invoking the `typeof` Operator on
the object as defined in [Section 12.5.5][] of the ECMAScript Language
Expand Down Expand Up @@ -3884,11 +3884,11 @@ napi_get_all_property_names(napi_env env,
* `[in] object`: The object from which to retrieve the properties.
* `[in] key_mode`: Whether to retrieve prototype properties as well.
* `[in] key_filter`: Which properties to retrieve
(enumerable/readable/writable).
(enumerable/readable/writable).
* `[in] key_conversion`: Whether to convert numbered property keys to strings.
* `[out] result`: A `napi_value` representing an array of JavaScript values
that represent the property names of the object. [`napi_get_array_length`][] and
[`napi_get_element`][] can be used to iterate over `result`.
that represent the property names of the object. [`napi_get_array_length`][]
and [`napi_get_element`][] can be used to iterate over `result`.

Returns `napi_ok` if the API succeeded.

Expand Down Expand Up @@ -4920,7 +4920,7 @@ napi_status napi_check_object_type_tag(napi_env env,
* `[in] js_object`: The JavaScript object whose type tag to examine.
* `[in] type_tag`: The tag with which to compare any tag found on the object.
* `[out] result`: Whether the type tag given matched the type tag on the
object. `false` is also returned if no type tag was found on the object.
object. `false` is also returned if no type tag was found on the object.

Returns `napi_ok` if the API succeeded.

Expand Down
Loading

0 comments on commit 168f346

Please sign in to comment.