Skip to content

Commit a58b48b

Browse files
committed
doc: various documentation formatting fixes
* Fix markdown code sample in releases.md, it was <a id="x.y.x></a>" * Fix some markdown errors, e.g. in changelogs * Fix broken defs links, e.g. in domain-postmortem.md * Fix other broken refs, by addaleax * Add links to some defs that were present but not linked to * Remove dead defs * Move defs to the bottom (one file affected) * Add language indicators to all code blocks, using `txt` when no specific language could be chosen * Some minor formatting changes (spaces, ident, headings) PR-URL: #7637 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
1 parent e09c62a commit a58b48b

36 files changed

+116
-136
lines changed

doc/api/addons.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ top-level of the project describing the build configuration of your module
102102
using a JSON-like format. This file is used by [node-gyp][] -- a tool written
103103
specifically to compile Node.js Addons.
104104

105-
```
105+
```json
106106
{
107107
"targets": [
108108
{
@@ -222,7 +222,7 @@ templates, etc.
222222

223223
Each of these examples using the following `binding.gyp` file:
224224

225-
```
225+
```json
226226
{
227227
"targets": [
228228
{
@@ -236,14 +236,14 @@ Each of these examples using the following `binding.gyp` file:
236236
In cases where there is more than one `.cc` file, simply add the additional
237237
filename to the `sources` array. For example:
238238

239-
```
239+
```json
240240
"sources": ["addon.cc", "myexample.cc"]
241241
```
242242

243243
Once the `binding.gyp` file is ready, the example Addons can be configured and
244244
built using `node-gyp`:
245245

246-
```
246+
```sh
247247
$ node-gyp configure build
248248
```
249249

@@ -621,7 +621,7 @@ void MyObject::PlusOne(const FunctionCallbackInfo<Value>& args) {
621621
To build this example, the `myobject.cc` file must be added to the
622622
`binding.gyp`:
623623
624-
```
624+
```json
625625
{
626626
"targets": [
627627
{
@@ -813,7 +813,7 @@ void MyObject::PlusOne(const FunctionCallbackInfo<Value>& args) {
813813
Once again, to build this example, the `myobject.cc` file must be added to the
814814
`binding.gyp`:
815815
816-
```
816+
```json
817817
{
818818
"targets": [
819819
{

doc/api/buffer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ significant impact* on performance. Use of the `--zero-fill-buffers` option is
114114
recommended only when absolutely necessary to enforce that newly allocated
115115
`Buffer` instances cannot contain potentially sensitive data.
116116

117-
```
117+
```txt
118118
$ node --zero-fill-buffers
119119
> Buffer.allocUnsafe(5);
120120
<Buffer 00 00 00 00 00>

doc/api/cluster.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if (cluster.isMaster) {
3535

3636
Running Node.js will now share port 8000 between the workers:
3737

38-
```
38+
```txt
3939
$ NODE_DEBUG=cluster node server.js
4040
23521,Master Worker 23524 online
4141
23521,Master Worker 23526 online

doc/api/debugger.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ via a simple [TCP-based protocol][] and built-in debugging client. To use it,
99
start Node.js with the `debug` argument followed by the path to the script to
1010
debug; a prompt will be displayed indicating successful launch of the debugger:
1111

12-
```
12+
```txt
1313
$ node debug myscript.js
1414
< debugger listening on port 5858
1515
connecting... ok
@@ -38,7 +38,7 @@ console.log('hello');
3838

3939
Once the debugger is run, a breakpoint will occur at line 4:
4040

41-
```
41+
```txt
4242
$ node debug myscript.js
4343
< debugger listening on port 5858
4444
connecting... ok
@@ -119,7 +119,7 @@ on line 1
119119
It is also possible to set a breakpoint in a file (module) that
120120
isn't loaded yet:
121121

122-
```
122+
```txt
123123
$ ./node debug test/fixtures/break-in-module/main.js
124124
< debugger listening on port 5858
125125
connecting to port 5858... ok

doc/api/dgram.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ and `udp6` sockets). The bound address and port can be retrieved using
425425
[`EventEmitter`]: events.html
426426
[`Buffer`]: buffer.html
427427
[`'close'`]: #dgram_event_close
428-
[`addMembership()`]: #dgram_socket_addmembership_multicastaddress_multicastinterface
429428
[`close()`]: #dgram_socket_close_callback
430429
[`dgram.createSocket()`]: #dgram_dgram_createsocket_options_callback
431430
[`dgram.Socket#bind()`]: #dgram_socket_bind_options_callback

doc/api/dns.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Alternatively, `options` can be an object containing these properties:
8686

8787
All properties are optional. An example usage of options is shown below.
8888

89-
```
89+
```js
9090
{
9191
family: 4,
9292
hints: dns.ADDRCONFIG | dns.V4MAPPED,
@@ -279,7 +279,7 @@ be an object with the following properties:
279279
* `expire`
280280
* `minttl`
281281

282-
```
282+
```js
283283
{
284284
nsname: 'ns.example.com',
285285
hostmaster: 'root.example.com',
@@ -305,7 +305,7 @@ be an array of objects with the following properties:
305305
* `port`
306306
* `name`
307307

308-
```
308+
```js
309309
{
310310
priority: 10,
311311
weight: 5,
@@ -437,8 +437,6 @@ uses. For instance, _they do not use the configuration from `/etc/hosts`_.
437437

438438
[DNS error codes]: #dns_error_codes
439439
[`dns.lookup()`]: #dns_dns_lookup_hostname_options_callback
440-
[`dns.resolve()`]: #dns_dns_resolve_hostname_rrtype_callback
441-
[`dns.resolve4()`]: #dns_dns_resolve4_hostname_callback
442440
[`dns.resolveSoa()`]: #dns_dns_resolvesoa_hostname_callback
443441
[`Error`]: errors.html#errors_class_error
444442
[Implementation considerations section]: #dns_implementation_considerations

doc/api/documentation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,26 @@ and in the process of being redesigned.
3737

3838
The stability indices are as follows:
3939

40-
```
40+
```txt
4141
Stability: 0 - Deprecated
4242
This feature is known to be problematic, and changes are
4343
planned. Do not rely on it. Use of the feature may cause warnings. Backwards
4444
compatibility should not be expected.
4545
```
4646

47-
```
47+
```txt
4848
Stability: 1 - Experimental
4949
This feature is subject to change, and is gated by a command line flag.
5050
It may change or be removed in future versions.
5151
```
5252

53-
```
53+
```txt
5454
Stability: 2 - Stable
5555
The API has proven satisfactory. Compatibility with the npm ecosystem
5656
is a high priority, and will not be broken unless absolutely necessary.
5757
```
5858

59-
```
59+
```txt
6060
Stability: 3 - Locked
6161
Only fixes related to security, performance, or bug fixes will be accepted.
6262
Please do not suggest API changes in this area; they will be refused.

doc/api/errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ instantiated.
268268

269269
For example:
270270

271-
```
271+
```txt
272272
Error: Things keep happening!
273273
at /home/gbusey/file.js:525:2
274274
at Frobnicator.refrobulate (/home/gbusey/business-logic.js:424:21)

doc/api/fs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Most fs functions let you omit the callback argument. If you do, a default
7474
callback is used that rethrows errors. To get a trace to the original call
7575
site, set the `NODE_DEBUG` environment variable:
7676

77-
```
77+
```txt
7878
$ cat script.js
7979
function bad() {
8080
require('fs').readFile('/');

doc/api/globals.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ but rather than loading the module, just return the resolved filename.
207207
[Modules]: modules.html#modules_modules
208208
[native addons]: addons.html
209209
[timers]: timers.html
210-
[`clearImmediate`]: timers.html#timers_clearimmediate_immediateobject
211-
[`clearInterval`]: timers.html#timers_clearinterval_immediateobject
212-
[`clearTimeout`]: timers.html#timers_cleartimeout_timeoutobject
210+
[`clearImmediate`]: timers.html#timers_clearimmediate_immediate
211+
[`clearInterval`]: timers.html#timers_clearinterval_timeout
212+
[`clearTimeout`]: timers.html#timers_cleartimeout_timeout
213213
[`setImmediate`]: timers.html#timers_setimmediate_callback_arg
214214
[`setInterval`]: timers.html#timers_setinterval_callback_delay_arg
215215
[`setTimeout`]: timers.html#timers_settimeout_callback_delay_arg

0 commit comments

Comments
 (0)