Skip to content

Commit 102fb7d

Browse files
richardsun29Myles Borins
authored and
Myles Borins
committed
doc: remove "above" and "below" references
The docs were recently refactored, and some "above" and "below" references were no longer accurate. This commit removes many such references, and replaces others with links. PR-URL: #4499 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent df87176 commit 102fb7d

13 files changed

+57
-45
lines changed

doc/api/child_process.markdown

+9-8
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ function provides equivalent functionality in a synchronous manner that blocks
3333
the event loop until the spawned process either exits of is terminated.
3434

3535
For convenience, the `child_process` module provides a handful of synchronous
36-
and asynchronous alternatives to `child_process.spawn()` and
37-
`child_process.spawnSync()`, each of which are documented fully [below][].
38-
*Note that each of these alternatives are implemented on top of
39-
`child_process.spawn()` or `child_process.spawnSync()`.*
36+
and asynchronous alternatives to [`child_process.spawn()`][] and
37+
[`child_process.spawnSync()`][]. *Note that each of these alternatives are
38+
implemented on top of `child_process.spawn()` or `child_process.spawnSync()`.*
4039

4140
* `child_process.exec()`: spawns a shell and runs a command within that shell,
4241
passing the `stdout` and `stderr` to a callback function when complete.
@@ -222,7 +221,8 @@ spawned directly as a new process making it slightly more efficient than
222221
(Default: `process.execArgv`)
223222
* `silent` {Boolean} If true, stdin, stdout, and stderr of the child will be
224223
piped to the parent, otherwise they will be inherited from the parent, see
225-
the `'pipe'` and `'inherit'` options for [`spawn()`][]'s [`stdio`][] for more details
224+
the `'pipe'` and `'inherit'` options for [`spawn()`][]'s [`stdio`][] for
225+
more details
226226
(default is false)
227227
* `uid` {Number} Sets the user identity of the process. (See setuid(2).)
228228
* `gid` {Number} Sets the group identity of the process. (See setgid(2).)
@@ -262,10 +262,10 @@ not clone the current process.*
262262
* `cwd` {String} Current working directory of the child process
263263
* `env` {Object} Environment key-value pairs
264264
* `stdio` {Array|String} Child's stdio configuration. (See
265-
[below](#child_process_options_stdio))
265+
[`options.stdio`][])
266266
* `detached` {Boolean} Prepare child to run independently of its parent
267267
process. Specific behavior depends on the platform, see
268-
[below](#child_process_options_detached))
268+
[`options.detached`][])
269269
* `uid` {Number} Sets the user identity of the process. (See setuid(2).)
270270
* `gid` {Number} Sets the group identity of the process. (See setgid(2).)
271271
* return: {ChildProcess object}
@@ -933,6 +933,7 @@ to the same value.
933933
[`EventEmitters`]: events.html#events_class_events_eventemitter
934934
[`net.Server`]: net.html#net_class_net_server
935935
[`net.Socket`]: net.html#net_class_net_socket
936+
[`options.detached`]: #child_process_options_detached
937+
[`options.stdio`]: #child_process_options_stdio
936938
[`stdio`]: #child_process_options_stdio
937-
[below]: #child_process_asynchronous_process_creation
938939
[synchronous counterparts]: #child_process_synchronous_process_creation

doc/api/crypto.markdown

+2-1
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in
972972
[RFC 2412][], but see [Caveats][]) and `'modp14'`, `'modp15'`,
973973
`'modp16'`, `'modp17'`, `'modp18'` (defined in [RFC 3526][]). The
974974
returned object mimics the interface of objects created by
975-
[`crypto.createDiffieHellman()`][] above, but will not allow changing
975+
[`crypto.createDiffieHellman()`][], but will not allow changing
976976
the keys (with [`diffieHellman.setPublicKey()`][] for example). The
977977
advantage of using this method is that the parties do not have to
978978
generate nor exchange a group modulus beforehand, saving both processor
@@ -1249,6 +1249,7 @@ See the reference for other recommendations and details.
12491249
[OpenSSL's SPKAC implementation]: https://www.openssl.org/docs/apps/spkac.html
12501250
[`createCipher()`]: #crypto_crypto_createcipher_algorithm_password
12511251
[`createCipheriv()`]: #crypto_crypto_createcipheriv_algorithm_key_iv
1252+
[`createHash()`]: #crypto_crypto_createhash_algorithm
12521253
[`crypto.createDecipher`]: #crypto_crypto_createdecipher_algorithm_password
12531254
[`crypto.createDecipheriv`]: #crypto_crypto_createdecipheriv_algorithm_key_iv
12541255
[`crypto.createDiffieHellman()`]: #crypto_crypto_creatediffiehellman_prime_prime_encoding_generator_generator_encoding

doc/api/dns.markdown

+5-4
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Alternatively, `options` can be an object containing these properties:
6969
`getaddrinfo` flags. If `hints` is not provided, then no flags are passed to
7070
`getaddrinfo`. Multiple flags can be passed through `hints` by logically
7171
`OR`ing their values.
72-
See [supported `getaddrinfo` flags][] below for more information on supported
72+
See [supported `getaddrinfo` flags][] for more information on supported
7373
flags.
7474
* `all`: {Boolean} - When `true`, the callback returns all resolved addresses
7575
in an array, otherwise returns a single address. Defaults to `false`.
@@ -151,10 +151,10 @@ Valid values for `rrtype` are:
151151
The `callback` function has arguments `(err, addresses)`. When successful,
152152
`addresses` will be an array. The type of each item in `addresses` is
153153
determined by the record type, and described in the documentation for the
154-
corresponding lookup methods below.
154+
corresponding lookup methods.
155155

156156
On error, `err` is an [`Error`][] object, where `err.code` is
157-
one of the error codes listed below.
157+
one of the error codes listed [here](#dns_error_codes).
158158

159159
## dns.resolve4(hostname, callback)
160160

@@ -250,7 +250,7 @@ The `callback` function has arguments `(err, hostnames)`, where `hostnames`
250250
is an array of resolved hostnames for the given `ip`.
251251

252252
On error, `err` is an [`Error`][] object, where `err.code` is
253-
one of the error codes listed below.
253+
one of the [DNS error codes][].
254254

255255
## dns.setServers(servers)
256256

@@ -335,6 +335,7 @@ processing that happens on libuv's threadpool that [`dns.lookup()`][] can have.
335335
They do not use the same set of configuration files than what [`dns.lookup()`][]
336336
uses. For instance, _they do not use the configuration from `/etc/hosts`_.
337337

338+
[DNS error codes]: #dns_error_codes
338339
[`dns.lookup()`]: #dns_dns_lookup_hostname_options_callback
339340
[`dns.resolve()`]: #dns_dns_resolve_hostname_rrtype_callback
340341
[`dns.resolve4()`]: #dns_dns_resolve4_hostname_callback

doc/api/errors.markdown

+1-2
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ The number of frames captured by the stack trace is bounded by the smaller of
317317
loop tick.
318318

319319
System-level errors are generated as augmented `Error` instances, which are
320-
detailed [below](#errors_system_errors).
320+
detailed [here](#errors_system_errors).
321321

322322
## Class: RangeError
323323

@@ -503,7 +503,6 @@ found [here][online].
503503
[`process.on('uncaughtException')`]: process.html#process_event_uncaughtexception
504504
[`try / catch` construct]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch
505505
[`try { } catch(err) { }`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch
506-
[below]: #errors_error_propagation_and_interception
507506
[domains]: domain.html
508507
[event emitter-based]: events.html#events_class_events_eventemitter
509508
[file descriptors]: https://en.wikipedia.org/wiki/File_descriptor

doc/api/fs.markdown

+3-2
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ Synchronous rmdir(2). Returns `undefined`.
659659
## fs.stat(path, callback)
660660

661661
Asynchronous stat(2). The callback gets two arguments `(err, stats)` where
662-
`stats` is a [`fs.Stats`][] object. See the [`fs.Stats`][] section below for more
662+
`stats` is a [`fs.Stats`][] object. See the [`fs.Stats`][] section for more
663663
information.
664664

665665
## fs.statSync(path)
@@ -743,7 +743,7 @@ The supported boolean members are `persistent` and `recursive`. `persistent`
743743
indicates whether the process should continue to run as long as files are being
744744
watched. `recursive` indicates whether all subdirectories should be watched, or
745745
only the current directory. This applies when a directory is specified, and only
746-
on supported platforms (See Caveats below).
746+
on supported platforms (See [Caveats][]).
747747

748748
The default is `{ persistent: true, recursive: false }`.
749749

@@ -929,6 +929,7 @@ Synchronous versions of [`fs.write()`][]. Returns the number of bytes written.
929929

930930
[`Buffer.byteLength`]: buffer.html#buffer_class_method_buffer_bytelength_string_encoding
931931
[`Buffer`]: buffer.html#buffer_buffer
932+
[Caveats]: #fs_caveats
932933
[`fs.access()`]: #fs_fs_access_path_mode_callback
933934
[`fs.accessSync()`]: #fs_fs_accesssync_path_mode
934935
[`fs.appendFile()`]: fs.html#fs_fs_appendfile_file_data_options_callback

doc/api/http.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ require developers to manually close the HTTP clients using
5252
KeepAlive.
5353

5454
If you opt into using HTTP KeepAlive, you can create an Agent object
55-
with that flag set to `true`. (See the [constructor options][] below.)
55+
with that flag set to `true`. (See the [constructor options][].)
5656
Then, the Agent will keep unused sockets in a pool for later use. They
5757
will be explicitly marked so as to not keep the Node.js process running.
5858
However, it is still a good idea to explicitly [`destroy()`][] KeepAlive

doc/api/modules.markdown

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ may itself have dependencies, and in some cases, these dependencies may even
9494
collide or form cycles.
9595

9696
Since Node.js looks up the `realpath` of any modules it loads (that is,
97-
resolves symlinks), and then looks for their dependencies in the
98-
`node_modules` folders as described above, this situation is very simple to
99-
resolve with the following architecture:
97+
resolves symlinks), and then looks for their dependencies in the `node_modules`
98+
folders as described [here](#modules_loading_from_node_modules_folders), this
99+
situation is very simple to resolve with the following architecture:
100100

101101
* `/usr/lib/node/foo/1.2.3/` - Contents of the `foo` package, version 1.2.3.
102102
* `/usr/lib/node/bar/4.3.2/` - Contents of the `bar` package that `foo`

doc/api/path.markdown

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ an empty string. Examples:
8383

8484
## path.format(pathObject)
8585

86-
Returns a path string from an object, the opposite of `path.parse` above.
86+
Returns a path string from an object, the opposite of [`path.parse`][].
8787

8888
path.format({
8989
root : "/",
@@ -276,3 +276,5 @@ An example on Windows:
276276

277277
Provide access to aforementioned `path` methods but always interact in a win32
278278
compatible way.
279+
280+
[`path.parse`]: #path_path_parse_pathstring

doc/api/process.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,7 @@ In cases like this, you may not want to track the rejection as a developer
165165
error like you would for other `'unhandledRejection'` events. To address
166166
this, you can either attach a dummy `.catch(function() { })` handler to
167167
`resource.loaded`, preventing the `'unhandledRejection'` event from being
168-
emitted, or you can use the `'rejectionHandled'` event. Below is an
169-
explanation of how to do that.
168+
emitted, or you can use the [`'rejectionHandled'`][] event.
170169

171170
## Exit Codes
172171

@@ -953,6 +952,7 @@ Will print something like:
953952
[`net.Socket`]: net.html#net_class_net_socket
954953
[`process.exit()`]: #process_process_exit_code
955954
[`promise.catch(...)`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch
955+
[`'rejectionHandled'`]: #process_event_rejectionhandled
956956
[`require.main`]: modules.html#modules_accessing_the_main_module
957957
[`setTimeout(fn, 0)`]: timers.html#timers_settimeout_callback_delay_arg
958958
[Signal Events]: #process_signal_events

doc/api/repl.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Previously in Node.js/io.js v2.x, REPL history was controlled by using a
5959
format. This variable has now been deprecated, and your REPL history will
6060
automatically be converted to using plain text. The new file will be saved to
6161
either your home directory, or a directory defined by the `NODE_REPL_HISTORY`
62-
variable, as documented below.
62+
variable, as documented [here](#repl_environment_variable_options).
6363

6464
## REPL Features
6565

doc/api/stream.markdown

+22-18
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ and properties depending on whether they are Readable, Writable, or
3737
Duplex.
3838

3939
If a stream is both Readable and Writable, then it implements all of
40-
the methods and events below. So, a [Duplex][] or [Transform][] stream is
40+
the methods and events. So, a [Duplex][] or [Transform][] stream is
4141
fully described by this API, though their implementation may be
4242
somewhat different.
4343

4444
It is not necessary to implement Stream interfaces in order to consume
4545
streams in your programs. If you **are** implementing streaming
4646
interfaces in your own program, please also refer to
47-
[API for Stream Implementors][] below.
47+
[API for Stream Implementors][].
4848

4949
Almost all Node.js programs, no matter how simple, use Streams in some
5050
way. Here is an example of using Streams in an Node.js program:
@@ -95,7 +95,7 @@ server.listen(1337);
9595
### Class: stream.Duplex
9696

9797
Duplex streams are streams that implement both the [Readable][] and
98-
[Writable][] interfaces. See above for usage.
98+
[Writable][] interfaces.
9999

100100
Examples of Duplex streams include:
101101

@@ -464,8 +464,8 @@ Note that `stream.unshift(chunk)` cannot be called after the `'end'` event
464464
has been triggered; a runtime error will be raised.
465465

466466
If you find that you must often call `stream.unshift(chunk)` in your
467-
programs, consider implementing a [Transform][] stream instead. (See API
468-
for Stream Implementors, below.)
467+
programs, consider implementing a [Transform][] stream instead. (See [API
468+
for Stream Implementors][].)
469469

470470
```javascript
471471
// Pull off a header delimited by \n\n
@@ -514,7 +514,7 @@ reading state appropriately, however it is best to simply avoid calling
514514
* `stream` {Stream} An "old style" readable stream
515515

516516
Versions of Node.js prior to v0.10 had streams that did not implement the
517-
entire Streams API as it is today. (See "Compatibility" below for
517+
entire Streams API as it is today. (See [Compatibility][] for
518518
more information.)
519519

520520
If you are using an older Node.js library that emits `'data'` events and
@@ -542,7 +542,7 @@ myReader.on('readable', () => {
542542

543543
Transform streams are [Duplex][] streams where the output is in some way
544544
computed from the input. They implement both the [Readable][] and
545-
[Writable][] interfaces. See above for usage.
545+
[Writable][] interfaces.
546546

547547
Examples of Transform streams include:
548548

@@ -789,7 +789,7 @@ of stream class you are writing:
789789
</table>
790790

791791
In your implementation code, it is very important to never call the
792-
methods described in [API for Stream Consumers][] above. Otherwise, you
792+
methods described in [API for Stream Consumers][]. Otherwise, you
793793
can potentially cause adverse side effects in programs that consume
794794
your streaming interfaces.
795795

@@ -843,7 +843,7 @@ it can come in handy as a building block for novel sorts of streams.
843843
`stream.Readable` is an abstract class designed to be extended with an
844844
underlying implementation of the [`_read(size)`][] method.
845845

846-
Please see above under [API for Stream Consumers][] for how to consume
846+
Please see [API for Stream Consumers][] for how to consume
847847
streams in your programs. What follows is an explanation of how to
848848
implement Readable streams in your programs.
849849

@@ -979,12 +979,13 @@ Counter.prototype._read = function() {
979979

980980
#### Example: SimpleProtocol v1 (Sub-optimal)
981981

982-
This is similar to the `parseHeader` function described above, but
983-
implemented as a custom stream. Also, note that this implementation
984-
does not convert the incoming data to a string.
982+
This is similar to the `parseHeader` function described
983+
[here](#stream_readable_unshift_chunk), but implemented as a custom stream.
984+
Also, note that this implementation does not convert the incoming data to a
985+
string.
985986

986987
However, this would be better implemented as a [Transform][] stream. See
987-
below for a better implementation.
988+
[SimpleProtocol v2][] for a better implementation.
988989

989990
```javascript
990991
// A parser for a simple data protocol.
@@ -1201,9 +1202,10 @@ your own extension classes.
12011202

12021203
#### Example: `SimpleProtocol` parser v2
12031204

1204-
The example above of a simple protocol parser can be implemented
1205-
simply by using the higher level [Transform][] stream class, similar to
1206-
the `parseHeader` and `SimpleProtocol v1` examples above.
1205+
The example [here](#stream_example_simpleprotocol_v1_sub_optimal) of a simple
1206+
protocol parser can be implemented simply by using the higher level
1207+
[Transform][] stream class, similar to the `parseHeader` and `SimpleProtocol
1208+
v1` examples.
12071209

12081210
In this example, rather than providing the input as an argument, it
12091211
would be piped into the parser, which is a more idiomatic Node.js stream
@@ -1284,7 +1286,7 @@ SimpleProtocol.prototype._transform = function(chunk, encoding, done) {
12841286
`stream.Writable` is an abstract class designed to be extended with an
12851287
underlying implementation of the [`_write(chunk, encoding, callback)`][] method.
12861288

1287-
Please see above under [API for Stream Consumers][] for how to consume
1289+
Please see [API for Stream Consumers][] for how to consume
12881290
writable streams in your programs. What follows is an explanation of
12891291
how to implement Writable streams in your programs.
12901292

@@ -1500,7 +1502,7 @@ simpler, but also less powerful and less useful.
15001502
meant that you still had to be prepared to receive `'data'` events
15011503
even when the stream was in a paused state.
15021504

1503-
In Node.js v0.10, the Readable class described below was added.
1505+
In Node.js v0.10, the [Readable][] class was added.
15041506
For backwards compatibility with older Node.js programs, Readable streams
15051507
switch into "flowing mode" when a `'data'` event handler is added, or
15061508
when the [`resume()`][] method is called. The effect is that, even if
@@ -1710,6 +1712,7 @@ horribly wrong.
17101712
[API for Stream Implementors]: #stream_api_for_stream_implementors
17111713
[child process stdin]: child_process.html#child_process_child_stdin
17121714
[child process stdout and stderr]: child_process.html#child_process_child_stdout
1715+
[Compatibility]: #stream_compatibility_with_older_node_js_versions
17131716
[crypto streams]: crypto.html
17141717
[crypto]: crypto.html
17151718
[Duplex]: #stream_class_stream_duplex
@@ -1722,6 +1725,7 @@ horribly wrong.
17221725
[Object mode]: #stream_object_mode
17231726
[Readable]: #stream_class_stream_readable
17241727
[request to an HTTP server]: http.html#http_http_incomingmessage
1728+
[SimpleProtocol v2]: #stream_example_simpleprotocol_parser_v2
17251729
[tcp sockets]: net.html#net_class_net_socket
17261730
[Transform]: #stream_class_stream_transform
17271731
[unpiped]: #stream_readable_unpipe_destination

doc/api/util.markdown

+4-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ formatted string:
161161
`2`. To make it recurse indefinitely pass `null`.
162162

163163
- `colors` - if `true`, then the output will be styled with ANSI color codes.
164-
Defaults to `false`. Colors are customizable, see below.
164+
Defaults to `false`. Colors are customizable, see [Customizing
165+
`util.inspect` colors][].
165166

166167
- `customInspect` - if `false`, then custom `inspect(depth, opts)` functions
167168
defined on the objects being inspected won't be called. Defaults to `true`.
@@ -507,4 +508,6 @@ Deprecated predecessor of `console.log`.
507508

508509
[`Array.isArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
509510
[constructor]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/constructor
511+
[Customizing `util.inspect` colors]: #util_customizing_util_inspect_colors
512+
[here]: #util_customizing_util_inspect_colors
510513
[`Error`]: errors.html#errors_class_error

doc/api/zlib.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ on requests, and the [content-encoding][] header on responses.
4444

4545
**Note: these examples are drastically simplified to show
4646
the basic concept.** Zlib encoding can be expensive, and the results
47-
ought to be cached. See [Memory Usage Tuning][] below for more information
47+
ought to be cached. See [Memory Usage Tuning][] for more information
4848
on the speed/memory/compression tradeoffs involved in zlib usage.
4949

5050
// client request example

0 commit comments

Comments
 (0)