Skip to content

Commit de9ad5b

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 c549ca3 commit de9ad5b

13 files changed

+57
-45
lines changed

doc/api/child_process.markdown

Lines changed: 9 additions & 8 deletions
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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in
978978
[RFC 2412][], but see [Caveats][]) and `'modp14'`, `'modp15'`,
979979
`'modp16'`, `'modp17'`, `'modp18'` (defined in [RFC 3526][]). The
980980
returned object mimics the interface of objects created by
981-
[`crypto.createDiffieHellman()`][] above, but will not allow changing
981+
[`crypto.createDiffieHellman()`][], but will not allow changing
982982
the keys (with [`diffieHellman.setPublicKey()`][] for example). The
983983
advantage of using this method is that the parties do not have to
984984
generate nor exchange a group modulus beforehand, saving both processor
@@ -1255,6 +1255,7 @@ See the reference for other recommendations and details.
12551255
[OpenSSL's SPKAC implementation]: https://www.openssl.org/docs/apps/spkac.html
12561256
[`createCipher()`]: #crypto_crypto_createcipher_algorithm_password
12571257
[`createCipheriv()`]: #crypto_crypto_createcipheriv_algorithm_key_iv
1258+
[`createHash()`]: #crypto_crypto_createhash_algorithm
12581259
[`crypto.createDecipher`]: #crypto_crypto_createdecipher_algorithm_password
12591260
[`crypto.createDecipheriv`]: #crypto_crypto_createdecipheriv_algorithm_key_iv
12601261
[`crypto.createDiffieHellman()`]: #crypto_crypto_creatediffiehellman_prime_prime_encoding_generator_generator_encoding

doc/api/dns.markdown

Lines changed: 5 additions & 4 deletions
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

Lines changed: 1 addition & 2 deletions
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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ Synchronous rmdir(2). Returns `undefined`.
667667
## fs.stat(path, callback)
668668

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

673673
## fs.statSync(path)
@@ -751,7 +751,7 @@ The supported boolean members are `persistent` and `recursive`. `persistent`
751751
indicates whether the process should continue to run as long as files are being
752752
watched. `recursive` indicates whether all subdirectories should be watched, or
753753
only the current directory. This applies when a directory is specified, and only
754-
on supported platforms (See Caveats below).
754+
on supported platforms (See [Caveats][]).
755755

756756
The default is `{ persistent: true, recursive: false }`.
757757

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

938938
[`Buffer.byteLength`]: buffer.html#buffer_class_method_buffer_bytelength_string_encoding
939939
[`Buffer`]: buffer.html#buffer_buffer
940+
[Caveats]: #fs_caveats
940941
[`fs.access()`]: #fs_fs_access_path_mode_callback
941942
[`fs.accessSync()`]: #fs_fs_accesssync_path_mode
942943
[`fs.appendFile()`]: fs.html#fs_fs_appendfile_file_data_options_callback

doc/api/http.markdown

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 3 additions & 1 deletion
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ In cases like this, you may not want to track the rejection as a developer
169169
error like you would for other `'unhandledRejection'` events. To address
170170
this, you can either attach a dummy `.catch(function() { })` handler to
171171
`resource.loaded`, preventing the `'unhandledRejection'` event from being
172-
emitted, or you can use the `'rejectionHandled'` event. Below is an
173-
explanation of how to do that.
172+
emitted, or you can use the [`'rejectionHandled'`][] event.
174173

175174
## Exit Codes
176175

@@ -984,6 +983,7 @@ Will print something like:
984983
[`net.Socket`]: net.html#net_class_net_socket
985984
[`process.exit()`]: #process_process_exit_code
986985
[`promise.catch(...)`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch
986+
[`'rejectionHandled'`]: #process_event_rejectionhandled
987987
[`require.main`]: modules.html#modules_accessing_the_main_module
988988
[`setTimeout(fn, 0)`]: timers.html#timers_settimeout_callback_delay_arg
989989
[Signal Events]: #process_signal_events

doc/api/repl.markdown

Lines changed: 1 addition & 1 deletion
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

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ and properties depending on whether they are Readable, Writable, or
3535
Duplex.
3636

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

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

4747
Almost all Node.js programs, no matter how simple, use Streams in some
4848
way. Here is an example of using Streams in an Node.js program:
@@ -93,7 +93,7 @@ server.listen(1337);
9393
### Class: stream.Duplex
9494

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

9898
Examples of Duplex streams include:
9999

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

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

468468
```javascript
469469
// Pull off a header delimited by \n\n
@@ -512,7 +512,7 @@ reading state appropriately, however it is best to simply avoid calling
512512
* `stream` {Stream} An "old style" readable stream
513513

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

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

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

545545
Examples of Transform streams include:
546546

@@ -787,7 +787,7 @@ of stream class you are writing:
787787
</table>
788788

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

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

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

@@ -978,12 +978,13 @@ Counter.prototype._read = function() {
978978

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

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

985986
However, this would be better implemented as a [Transform][] stream. See
986-
below for a better implementation.
987+
[SimpleProtocol v2][] for a better implementation.
987988

988989
```javascript
989990
// A parser for a simple data protocol.
@@ -1202,9 +1203,10 @@ your own extension classes.
12021203

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

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

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

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

@@ -1503,7 +1505,7 @@ simpler, but also less powerful and less useful.
15031505
meant that you still had to be prepared to receive `'data'` events
15041506
even when the stream was in a paused state.
15051507

1506-
In Node.js v0.10, the Readable class described below was added.
1508+
In Node.js v0.10, the [Readable][] class was added.
15071509
For backwards compatibility with older Node.js programs, Readable streams
15081510
switch into "flowing mode" when a `'data'` event handler is added, or
15091511
when the [`resume()`][] method is called. The effect is that, even if
@@ -1713,6 +1715,7 @@ horribly wrong.
17131715
[API for Stream Implementors]: #stream_api_for_stream_implementors
17141716
[child process stdin]: child_process.html#child_process_child_stdin
17151717
[child process stdout and stderr]: child_process.html#child_process_child_stdout
1718+
[Compatibility]: #stream_compatibility_with_older_node_js_versions
17161719
[crypto streams]: crypto.html
17171720
[crypto]: crypto.html
17181721
[Duplex]: #stream_class_stream_duplex
@@ -1725,6 +1728,7 @@ horribly wrong.
17251728
[Object mode]: #stream_object_mode
17261729
[Readable]: #stream_class_stream_readable
17271730
[request to an HTTP server]: http.html#http_http_incomingmessage
1731+
[SimpleProtocol v2]: #stream_example_simpleprotocol_parser_v2
17281732
[tcp sockets]: net.html#net_class_net_socket
17291733
[Transform]: #stream_class_stream_transform
17301734
[unpiped]: #stream_readable_unpipe_destination

doc/api/util.markdown

Lines changed: 4 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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)