Skip to content

Commit 17f641b

Browse files
docs: make note formatting more consistent (#3520)
* docs: make note formatting more consistent * docs: removed Note word from notes * docs: fix missed note Co-authored-by: XhmikosR <xhmikosr@gmail.com>
1 parent f402bb7 commit 17f641b

5 files changed

Lines changed: 53 additions & 54 deletions

File tree

locale/en/docs/guides/anatomy-of-an-http-transaction.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ relatively painless by putting handy properties onto the `request` object.
5757
const { method, url } = request;
5858
```
5959

60-
> **Note:** The `request` object is an instance of [`IncomingMessage`][].
60+
> The `request` object is an instance of [`IncomingMessage`][].
6161
6262
The `method` here will always be a normal HTTP method/verb. The `url` is the
6363
full URL without the server, protocol or port. For a typical URL, this means
@@ -102,7 +102,7 @@ request.on('data', (chunk) => {
102102
});
103103
```
104104

105-
> **Note:** This may seem a tad tedious, and in many cases, it is. Luckily,
105+
> This may seem a tad tedious, and in many cases, it is. Luckily,
106106
> there are modules like [`concat-stream`][] and [`body`][] on [`npm`][] which can
107107
> help hide away some of this logic. It's important to have a good understanding
108108
> of what's going on before going down that road, and that's why you're here!
@@ -230,7 +230,7 @@ last bit of data on the stream, so we can simplify the example above as follows.
230230
response.end('<html><body><h1>Hello, World!</h1></body></html>');
231231
```
232232

233-
> **Note:** It's important to set the status and headers *before* you start
233+
> It's important to set the status and headers *before* you start
234234
> writing chunks of data to the body. This makes sense, since headers come before
235235
> the body in HTTP responses.
236236
@@ -330,7 +330,7 @@ http.createServer((request, response) => {
330330
}).listen(8080);
331331
```
332332

333-
> **Note:** By checking the URL in this way, we're doing a form of "routing".
333+
> By checking the URL in this way, we're doing a form of "routing".
334334
> Other forms of routing can be as simple as `switch` statements or as complex as
335335
> whole frameworks like [`express`][]. If you're looking for something that does
336336
> routing and nothing else, try [`router`][].

locale/en/docs/guides/backpressuring-in-streams.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ To test the results, try opening each compressed file. The file compressed by
8181
the [`zip(1)`][] tool will notify you the file is corrupt, whereas the
8282
compression finished by [`Stream`][] will decompress without error.
8383

84-
Note: In this example, we use `.pipe()` to get the data source from one end
85-
to the other. However, notice there are no proper error handlers attached. If
86-
a chunk of data were to fail to be properly received, the `Readable` source or
87-
`gzip` stream will not be destroyed. [`pump`][] is a utility tool that would
88-
properly destroy all the streams in a pipeline if one of them fails or closes,
89-
and is a must have in this case!
84+
> In this example, we use `.pipe()` to get the data source from one end
85+
> to the other. However, notice there are no proper error handlers attached. If
86+
> a chunk of data were to fail to be properly received, the `Readable` source or
87+
> `gzip` stream will not be destroyed. [`pump`][] is a utility tool that would
88+
> properly destroy all the streams in a pipeline if one of them fails or closes,
89+
> and is a must have in this case!
9090
9191
[`pump`][] is only necessary for Node.js 8.x or earlier, as for Node.js 10.x
9292
or later version, [`pipeline`][] is introduced to replace for [`pump`][].
@@ -354,11 +354,11 @@ Well the answer is simple: Node.js does all of this automatically for you.
354354
That's so great! But also not so great when we are trying to understand how to
355355
implement our own custom streams.
356356

357-
Note: In most machines, there is a byte size that determines when a buffer
358-
is full (which will vary across different machines). Node.js allows you to set
359-
your own custom [`highWaterMark`][], but commonly, the default is set to 16kb
360-
(16384, or 16 for objectMode streams). In instances where you might
361-
want to raise that value, go for it, but do so with caution!
357+
> In most machines, there is a byte size that determines when a buffer
358+
> is full (which will vary across different machines). Node.js allows you to set
359+
> your own custom [`highWaterMark`][], but commonly, the default is set to 16kb
360+
> (16384, or 16 for objectMode streams). In instances where you might
361+
> want to raise that value, go for it, but do so with caution!
362362
363363
## Lifecycle of `.pipe()`
364364

@@ -410,9 +410,9 @@ stream:
410410
+============+
411411
```
412412

413-
Note: If you are setting up a pipeline to chain together a few streams to
414-
manipulate your data, you will most likely be implementing [`Transform`][]
415-
stream.
413+
> If you are setting up a pipeline to chain together a few streams to
414+
> manipulate your data, you will most likely be implementing [`Transform`][]
415+
> stream.
416416
417417
In this case, your output from your [`Readable`][] stream will enter in the
418418
[`Transform`][] and will pipe into the [`Writable`][].
@@ -450,11 +450,11 @@ In general,
450450
3. Streams changes between different Node.js versions, and the library you use.
451451
Be careful and test things.
452452

453-
Note: In regards to point 3, an incredibly useful package for building
454-
browser streams is [`readable-stream`][]. Rodd Vagg has written a
455-
[great blog post][] describing the utility of this library. In short, it
456-
provides a type of automated graceful degradation for [`Readable`][] streams,
457-
and supports older versions of browsers and Node.js.
453+
> In regards to point 3, an incredibly useful package for building
454+
> browser streams is [`readable-stream`][]. Rodd Vagg has written a
455+
> [great blog post][] describing the utility of this library. In short, it
456+
> provides a type of automated graceful degradation for [`Readable`][] streams,
457+
> and supports older versions of browsers and Node.js.
458458
459459
## Rules specific to Readable Streams
460460

locale/en/docs/guides/event-loop-timers-and-nexttick.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ order of operations.
4848
└───────────────────────────┘
4949
```
5050

51-
*note: each box will be referred to as a "phase" of the event loop.*
51+
> Each box will be referred to as a "phase" of the event loop.
5252
5353
Each phase has a FIFO queue of callbacks to execute. While each phase is
5454
special in its own way, generally, when the event loop enters a given
@@ -65,11 +65,11 @@ result, long running callbacks can allow the poll phase to run much
6565
longer than a timer's threshold. See the [**timers**](#timers) and
6666
[**poll**](#poll) sections for more details.
6767

68-
_**NOTE:** There is a slight discrepancy between the Windows and the
69-
Unix/Linux implementation, but that's not important for this
70-
demonstration. The most important parts are here. There are actually
71-
seven or eight steps, but the ones we care about — ones that Node.js
72-
actually uses - are those above._
68+
> There is a slight discrepancy between the Windows and the
69+
> Unix/Linux implementation, but that's not important for this
70+
> demonstration. The most important parts are here. There are actually
71+
> seven or eight steps, but the ones we care about — ones that Node.js
72+
> actually uses - are those above.
7373
7474
## Phases Overview
7575

@@ -99,8 +99,7 @@ scheduled after the specified amount of time has passed; however,
9999
Operating System scheduling or the running of other callbacks may delay
100100
them.
101101

102-
_**Note**: Technically, the [**poll** phase](#poll) controls when timers
103-
are executed._
102+
> Technically, the [**poll** phase](#poll) controls when timers are executed.
104103
105104
For example, say you schedule a timeout to execute after a 100 ms
106105
threshold, then your script starts asynchronously reading a file which
@@ -145,11 +144,11 @@ the timer's callback. In this example, you will see that the total delay
145144
between the timer being scheduled and its callback being executed will
146145
be 105ms.
147146

148-
Note: To prevent the **poll** phase from starving the event loop, [libuv][]
149-
(the C library that implements the Node.js
150-
event loop and all of the asynchronous behaviors of the platform)
151-
also has a hard maximum (system dependent) before it stops polling for
152-
more events.
147+
> To prevent the **poll** phase from starving the event loop, [libuv][]
148+
> (the C library that implements the Node.js
149+
> event loop and all of the asynchronous behaviors of the platform)
150+
> also has a hard maximum (system dependent) before it stops polling for
151+
> more events.
153152
154153
### pending callbacks
155154

@@ -411,8 +410,8 @@ percentage of the packages on npm. Every day more new modules are being
411410
added, which means every day we wait, more potential breakages occur.
412411
While they are confusing, the names themselves won't change.
413412

414-
*We recommend developers use `setImmediate()` in all cases because it's
415-
easier to reason about.*
413+
> We recommend developers use `setImmediate()` in all cases because it's
414+
> easier to reason about.
416415
417416
## Why use `process.nextTick()`?
418417

locale/en/docs/guides/publishing-napi-modules.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ will look like this:
3939
}
4040
```
4141

42-
**Note:** As explained in
43-
["Using dist-tags"][], unlike regular versions, tagged versions cannot be
44-
addressed by version ranges such as `"^2.0.0"` inside `package.json`. The
45-
reason for this is that the tag refers to exactly one version. So, if the
46-
package maintainer chooses to tag a later version of the package using the
47-
same tag, `npm update` will receive the later version. This should be acceptable
48-
given the currently experimental nature of N-API. To depend on an N-API-enabled
49-
version other than the latest published, the `package.json` dependency will
50-
have to refer to the exact version like the following:
42+
> As explained in
43+
> ["Using dist-tags"][], unlike regular versions, tagged versions cannot be
44+
> addressed by version ranges such as `"^2.0.0"` inside `package.json`. The
45+
> reason for this is that the tag refers to exactly one version. So, if the
46+
> package maintainer chooses to tag a later version of the package using the
47+
> same tag, `npm update` will receive the later version. This should be acceptable
48+
> given the currently experimental nature of N-API. To depend on an N-API-enabled
49+
> version other than the latest published, the `package.json` dependency will
50+
> have to refer to the exact version like the following:
5151
5252
```json
5353
"dependencies": {

locale/en/docs/guides/timers-in-node.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ executing immediate: so immediate
9191
`setImmediate()` returns an `Immediate` object, which can be used to cancel
9292
the scheduled immediate (see `clearImmediate()` below).
9393

94-
Note: Don't get `setImmediate()` confused with `process.nextTick()`. There are
95-
some major ways they differ. The first is that `process.nextTick()` will run
96-
*before* any `Immediate`s that are set as well as before any scheduled I/O.
97-
The second is that `process.nextTick()` is non-clearable, meaning once
98-
code has been scheduled to execute with `process.nextTick()`, the execution
99-
cannot be stopped, just like with a normal function. Refer to [this guide](/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick)
100-
to better understand the operation of `process.nextTick()`.
94+
> Don't get `setImmediate()` confused with `process.nextTick()`. There are
95+
> some major ways they differ. The first is that `process.nextTick()` will run
96+
> *before* any `Immediate`s that are set as well as before any scheduled I/O.
97+
> The second is that `process.nextTick()` is non-clearable, meaning once
98+
> code has been scheduled to execute with `process.nextTick()`, the execution
99+
> cannot be stopped, just like with a normal function. Refer to [this guide](/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick)
100+
> to better understand the operation of `process.nextTick()`.
101101
102102
### "Infinite Loop" Execution ~ *`setInterval()`*
103103

0 commit comments

Comments
 (0)