Skip to content

Commit c2393d1

Browse files
benglFishrock123
authored andcommittedNov 17, 2015
doc: consistent reference-style links
Moved all the URLs in API docs to the bottom of the files as reference-style links. PR-URL: #3845 Reviewed-By: James M Snell <[email protected]>
1 parent 4bb27ba commit c2393d1

28 files changed

+372
-311
lines changed
 

‎doc/api/addons.markdown

+18-15
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ knowledge of several libraries:
77
- V8 JavaScript, a C++ library. Used for interfacing with JavaScript:
88
creating objects, calling functions, etc. Documented mostly in the
99
`v8.h` header file (`deps/v8/include/v8.h` in the Node.js source
10-
tree), which is also available
11-
[online](https://v8docs.nodesource.com/).
10+
tree), which is also available [online][].
1211

13-
- [libuv](https://github.com/libuv/libuv), C event loop library.
14-
Anytime one needs to wait for a file descriptor to become readable,
15-
wait for a timer, or wait for a signal to be received one will need
16-
to interface with libuv. That is, if you perform any I/O, libuv will
17-
need to be used.
12+
- [libuv][], C event loop library. Anytime one needs to wait for a file
13+
descriptor to become readable, wait for a timer, or wait for a signal
14+
to be received one will need to interface with libuv. That is, if you
15+
perform any I/O, libuv will need to be used.
1816

1917
- Internal Node.js libraries. Most importantly is the `node::ObjectWrap`
2018
class which you will likely want to derive from.
@@ -25,9 +23,8 @@ Node.js statically compiles all its dependencies into the executable.
2523
When compiling your module, you don't need to worry about linking to
2624
any of these libraries.
2725

28-
All of the following examples are available for
29-
[download](https://github.com/rvagg/node-addon-examples) and may be
30-
used as a starting-point for your own Addon.
26+
All of the following examples are available for [download][] and may
27+
be used as a starting-point for your own Addon.
3128

3229
## Hello world
3330

@@ -77,7 +74,7 @@ The `module_name` needs to match the filename of the final binary (minus the
7774
The source code needs to be built into `addon.node`, the binary Addon. To
7875
do this we create a file called `binding.gyp` which describes the configuration
7976
to build your module in a JSON-like format. This file gets compiled by
80-
[node-gyp](https://github.com/nodejs/node-gyp).
77+
[node-gyp][].
8178

8279
{
8380
"targets": [
@@ -113,10 +110,9 @@ Please see patterns below for further information or
113110
## Addon patterns
114111

115112
Below are some addon patterns to help you get started. Consult the online
116-
[v8 reference](http://izs.me/v8-docs/main.html) for help with the various v8
117-
calls, and v8's [Embedder's Guide](http://code.google.com/apis/v8/embed.html)
118-
for an explanation of several concepts used such as handles, scopes,
119-
function templates, etc.
113+
[v8 reference][] for help with the various v8 calls, and v8's
114+
[Embedder's Guide][] for an explanation of several concepts used such as
115+
handles, scopes, function templates, etc.
120116

121117
In order to use these examples you need to compile them using `node-gyp`.
122118
Create the following `binding.gyp` file:
@@ -869,3 +865,10 @@ Test in JavaScript by running:
869865

870866
// test.js
871867
var addon = require('./build/Release/addon');
868+
869+
[online]: https://v8docs.nodesource.com/
870+
[libuv]: https://github.com/libuv/libuv
871+
[download]: https://github.com/rvagg/node-addon-examples
872+
[node-gyp]: https://github.com/nodejs/node-gyp
873+
[v8 reference]: http://izs.me/v8-docs/main.html
874+
[Embedder's Guide]: http://code.google.com/apis/v8/embed.html

‎doc/api/assert.markdown

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ operator ( `===` ).
3232

3333
## assert.doesNotThrow(block[, error][, message])
3434

35-
Expects `block` not to throw an error. See [assert.throws()](#assert_assert_throws_block_error_message) for more details.
35+
Expects `block` not to throw an error. See [assert.throws()][] for more details.
3636

3737
If `block` throws an error and if it is of a different type from `error`, the
3838
thrown error will get propagated back to the caller. The following call will
@@ -128,3 +128,5 @@ Custom error validation:
128128
},
129129
"unexpected error"
130130
);
131+
132+
[assert.throws()]: #assert_assert_throws_block_error_message

‎doc/api/buffer.markdown

+8-7
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ Example:
114114
* `buf1` {Buffer}
115115
* `buf2` {Buffer}
116116

117-
The same as [`buf1.compare(buf2)`](#buffer_buf_compare_otherbuffer). Useful
118-
for sorting an Array of Buffers:
117+
The same as [`buf1.compare(buf2)`][]. Useful for sorting an Array of Buffers:
119118

120119
var arr = [Buffer('1234'), Buffer('0123')];
121120
arr.sort(Buffer.compare);
@@ -287,11 +286,10 @@ buffer.
287286
* `byteOffset` Number, Optional, Default: 0
288287
* Return: Number
289288

290-
Operates similar to
291-
[Array#indexOf()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf).
292-
Accepts a String, Buffer or Number. Strings are interpreted as UTF8. Buffers
293-
will use the entire buffer. So in order to compare a partial Buffer use
294-
`Buffer#slice()`. Numbers can range from 0 to 255.
289+
Operates similar to [Array#indexOf()][]. Accepts a String, Buffer or Number.
290+
Strings are interpreted as UTF8. Buffers will use the entire buffer. So in order
291+
to compare a partial Buffer use `Buffer#slice()`. Numbers can range from 0 to
292+
255.
295293

296294
### buf.length
297295

@@ -932,3 +930,6 @@ un-pooled Buffer instance using SlowBuffer and copy out the relevant bits.
932930

933931
Though this should be used sparingly and only be a last resort *after* a developer
934932
has actively observed undue memory retention in their applications.
933+
934+
[`buf1.compare(buf2)`]: #buffer_buf_compare_otherbuffer
935+
[Array#indexOf()]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf

‎doc/api/child_process.markdown

+29-22
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ data you send to the child process may not be immediately consumed.)
1212

1313
To create a child process use `require('child_process').spawn()` or
1414
`require('child_process').fork()`. The semantics of each are slightly
15-
different, and explained [below](#child_process_asynchronous_process_creation).
15+
different, and explained [below][].
1616

17-
For scripting purposes you may find the
18-
[synchronous counterparts](#child_process_synchronous_process_creation) more
17+
For scripting purposes you may find the [synchronous counterparts][] more
1918
convenient.
2019

2120
## Class: ChildProcess
@@ -61,8 +60,7 @@ Note that the `exit`-event may or may not fire after an error has occurred. If
6160
you are listening on both events to fire a function, remember to guard against
6261
calling your function twice.
6362

64-
See also [`ChildProcess#kill()`](#child_process_child_kill_signal) and
65-
[`ChildProcess#send()`](#child_process_child_send_message_sendhandle_callback).
63+
See also [`ChildProcess#kill()`][] and [`ChildProcess#send()`][].
6664

6765
### Event: 'exit'
6866

@@ -161,7 +159,7 @@ Example:
161159
* `callback` {Function}
162160
* Return: Boolean
163161

164-
When using [`child_process.fork()`](#child_process_child_process_fork_modulepath_args_options) you can write to the child using
162+
When using [`child_process.fork()`][] you can write to the child using
165163
`child.send(message[, sendHandle][, callback])` and messages are received by
166164
a `'message'` event on the child.
167165

@@ -310,9 +308,7 @@ to the same object, or null.
310308
* {Array}
311309

312310
A sparse array of pipes to the child process, corresponding with positions in
313-
the [stdio](#child_process_options_stdio) option to
314-
[spawn](#child_process_child_process_spawn_command_args_options) that have been
315-
set to `'pipe'`.
311+
the [stdio][] option to [spawn][] that have been set to `'pipe'`.
316312
Note that streams 0-2 are also available as ChildProcess.stdin,
317313
ChildProcess.stdout, and ChildProcess.stderr, respectively.
318314

@@ -439,9 +435,9 @@ the existing process and uses a shell to execute the command.*
439435
* `stderr` {Buffer}
440436
* Return: ChildProcess object
441437

442-
This is similar to [`child_process.exec()`](#child_process_child_process_exec_command_options_callback) except it does not execute a
438+
This is similar to [`child_process.exec()`][] except it does not execute a
443439
subshell but rather the specified file directly. This makes it slightly
444-
leaner than [`child_process.exec()`](#child_process_child_process_exec_command_options_callback). It has the same options.
440+
leaner than [`child_process.exec()`][]. It has the same options.
445441

446442

447443
### child_process.fork(modulePath[, args][, options])
@@ -462,10 +458,10 @@ leaner than [`child_process.exec()`](#child_process_child_process_exec_command_o
462458
* `gid` {Number} Sets the group identity of the process. (See setgid(2).)
463459
* Return: ChildProcess object
464460

465-
This is a special case of the [`child_process.spawn()`](#child_process_child_process_spawn_command_args_options) functionality for spawning Node.js
466-
processes. In addition to having all the methods in a normal ChildProcess
467-
instance, the returned object has a communication channel built-in. See
468-
[`child.send(message, [sendHandle])`](#child_process_child_send_message_sendhandle_callback) for details.
461+
This is a special case of the [`child_process.spawn()`][] functionality for
462+
spawning Node.js processes. In addition to having all the methods in a normal
463+
ChildProcess instance, the returned object has a communication channel built-in.
464+
See [`child.send(message, [sendHandle])`][] for details.
469465

470466
These child Node.js processes are still whole new instances of V8. Assume at
471467
least 30ms startup and 10mb memory for each new Node.js. That is, you cannot
@@ -663,7 +659,7 @@ Example:
663659
// startd-style interface.
664660
spawn('prg', [], { stdio: ['pipe', null, null, null, 'pipe'] });
665661

666-
See also: [`child_process.exec()`](#child_process_child_process_exec_command_options_callback) and [`child_process.fork()`](#child_process_child_process_fork_modulepath_args_options)
662+
See also: [`child_process.exec()`][] and [`child_process.fork()`][]
667663

668664
## Synchronous Process Creation
669665

@@ -703,11 +699,7 @@ process has exited.
703699

704700
If the process times out, or has a non-zero exit code, this method ***will***
705701
throw. The `Error` object will contain the entire result from
706-
[`child_process.spawnSync()`](#child_process_child_process_spawnsync_command_args_options)
707-
708-
[EventEmitter]: events.html#events_class_events_eventemitter
709-
[net.Server]: net.html#net_class_net_server
710-
[net.Socket]: net.html#net_class_net_socket
702+
[`child_process.spawnSync()`][]
711703

712704
### child_process.execSync(command[, options])
713705

@@ -741,7 +733,7 @@ process has exited.
741733

742734
If the process times out, or has a non-zero exit code, this method ***will***
743735
throw. The `Error` object will contain the entire result from
744-
[`child_process.spawnSync()`](#child_process_child_process_spawnsync_command_args_options)
736+
[`child_process.spawnSync()`][]
745737

746738
### child_process.spawnSync(command[, args][, options])
747739

@@ -774,3 +766,18 @@ timeout has been encountered and `killSignal` is sent, the method won't return
774766
until the process has completely exited. That is to say, if the process handles
775767
the `SIGTERM` signal and doesn't exit, your process will wait until the child
776768
process has exited.
769+
770+
[below]: #child_process_asynchronous_process_creation
771+
[synchronous counterparts]: #child_process_synchronous_process_creation
772+
[EventEmitter]: events.html#events_class_events_eventemitter
773+
[`ChildProcess#kill()`]: #child_process_child_kill_signal
774+
[`ChildProcess#send()`]: #child_process_child_send_message_sendhandle_callback
775+
[net.Server]: net.html#net_class_net_server
776+
[net.Socket]: net.html#net_class_net_socket
777+
[`child_process.fork()`]: #child_process_child_process_fork_modulepath_args_options
778+
[stdio]: #child_process_options_stdio
779+
[spawn]: #child_process_child_process_spawn_command_args_options
780+
[`child_process.exec()`]: #child_process_child_process_exec_command_options_callback
781+
[`child_process.spawn()`]: #child_process_child_process_spawn_command_args_options
782+
[`child.send(message, [sendHandle])`]: #child_process_child_send_message_sendhandle_callback
783+
[`child_process.spawnSync()`]: #child_process_child_process_spawnsync_command_args_options

‎doc/api/cluster.markdown

+15-11
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ This event is the same as the one provided by `child_process.fork()`.
123123

124124
In a worker you can also use `process.on('error')`.
125125

126-
[ChildProcess.send()]: child_process.html#child_process_child_send_message_sendhandle_callback
127-
128126
### Event: 'exit'
129127

130128
* `code` {Number} the exit code, if it exited normally.
@@ -232,15 +230,15 @@ Causes `.suicide` to be set.
232230
Note that after a server is closed, it will no longer accept new connections,
233231
but connections may be accepted by any other listening worker. Existing
234232
connections will be allowed to close as usual. When no more connections exist,
235-
see [server.close()](net.html#net_event_close), the IPC channel to the worker
236-
will close allowing it to die gracefully.
233+
see [server.close()][], the IPC channel to the worker will close allowing it to
234+
die gracefully.
237235

238236
The above applies *only* to server connections, client connections are not
239237
automatically closed by workers, and disconnect does not wait for them to close
240238
before exiting.
241239

242240
Note that in a worker, `process.disconnect` exists, but it is not this function,
243-
it is [disconnect](child_process.html#child_process_child_disconnect).
241+
it is [disconnect][].
244242

245243
Because long living server connections may block workers from disconnecting, it
246244
may be useful to send a message, so application specific actions may be taken to
@@ -313,7 +311,7 @@ Causes `.suicide` to be set.
313311
This method is aliased as `worker.destroy()` for backwards compatibility.
314312

315313
Note that in a worker, `process.kill()` exists, but it is not this function,
316-
it is [kill](process.html#process_process_kill_pid_signal).
314+
it is [kill][].
317315

318316
### worker.process
319317

@@ -323,8 +321,7 @@ All workers are created using `child_process.fork()`, the returned object
323321
from this function is stored as `.process`. In a worker, the global `process`
324322
is stored.
325323

326-
See: [Child Process module](
327-
child_process.html#child_process_child_process_fork_modulepath_args_options)
324+
See: [Child Process module][]
328325

329326
Note that workers will call `process.exit(0)` if the `'disconnect'` event occurs
330327
on `process` and `.suicide` is not `true`. This protects against accidental
@@ -408,7 +405,7 @@ This can be used to restart the worker by calling `.fork()` again.
408405
cluster.fork();
409406
});
410407

411-
See [child_process event: 'exit'](child_process.html#child_process_event_exit).
408+
See [child_process event: 'exit'][].
412409

413410
## Event: 'fork'
414411

@@ -464,8 +461,7 @@ The `addressType` is one of:
464461

465462
Emitted when any worker receives a message.
466463

467-
See
468-
[child_process event: 'message'](child_process.html#child_process_event_message).
464+
See [child_process event: 'message'][].
469465

470466
## Event: 'online'
471467

@@ -647,3 +643,11 @@ the worker's unique id is the easiest way to find the worker.
647643
socket.on('data', function(id) {
648644
var worker = cluster.workers[id];
649645
});
646+
647+
[server.close()]: net.html#net_event_close
648+
[disconnect]: child_process.html#child_process_child_disconnect
649+
[kill]: process.html#process_process_kill_pid_signal
650+
[Child Process module]: child_process.html#child_process_child_process_fork_modulepath_args_options
651+
[ChildProcess.send()]: child_process.html#child_process_child_send_message_sendhandle_callback
652+
[child_process event: 'exit']: child_process.html#child_process_event_exit
653+
[child_process event: 'message']: child_process.html#child_process_event_message.

‎doc/api/console.markdown

+9-8
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ The global `console` is a special `Console` whose output is sent to
4343

4444
new Console(process.stdout, process.stderr);
4545

46-
[assert.ok()]: assert.html#assert_assert_value_message_assert_ok_value_message
47-
[util.format()]: util.html#util_util_format_format
48-
[customizing util.inspect colors]: util.html#util_customizing_util_inspect_colors
49-
5046
## console
5147

5248
* {Object}
@@ -113,14 +109,13 @@ is used on each argument. See [util.format()][] for more information.
113109

114110
Starts a timer that can be used to compute the duration of an operation. Timers
115111
are identified by a unique name. Use the same name when you call
116-
[`console.timeEnd()`](#console_console_timeend_label) to stop the timer and
117-
output the elapsed time in milliseconds. Timer durations are accurate to the
118-
sub-millisecond.
112+
[`console.timeEnd()`][] to stop the timer and output the elapsed time in
113+
milliseconds. Timer durations are accurate to the sub-millisecond.
119114

120115
### console.timeEnd(label)
121116

122117
Stops a timer that was previously started by calling
123-
[`console.time()`](#console_console_time_label) and prints the result to the
118+
[`console.time()`][] and prints the result to the
124119
console.
125120

126121
Example:
@@ -140,3 +135,9 @@ to the current position.
140135
### console.warn([data][, ...])
141136

142137
Same as `console.error`.
138+
139+
[assert.ok()]: assert.html#assert_assert_value_message_assert_ok_value_message
140+
[customizing util.inspect colors]: util.html#util_customizing_util_inspect_colors
141+
[util.format()]: util.html#util_util_format_format
142+
[`console.timeEnd()`]: #console_console_timeend_label
143+
[`console.time()`]: #console_console_time_label

0 commit comments

Comments
 (0)
Please sign in to comment.