Skip to content

Commit 7743e0f

Browse files
fix: content overflow on small screen (#1948)
* update tables in 5.x for consistency in design * update tables in 4.x for consistency in design * remove content overflow for mobile devices * remove inline padding from main conatent --------- Co-authored-by: Sebastian Beltran <bjohansebas@gmail.com>
1 parent c7b12bd commit 7743e0f

23 files changed

Lines changed: 349 additions & 228 deletions

_includes/api/en/4x/app-METHOD.md

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,37 @@ PUT, POST, and so on, in lowercase. Thus, the actual methods are `app.get()`,
1010

1111
Express supports the following routing methods corresponding to the HTTP methods of the same names:
1212

13-
<table style="border: 0px; background: none">
14-
<tr>
15-
<td style="background: none; border: 0px;" markdown="1">
16-
* `checkout`
17-
* `copy`
18-
* `delete`
19-
* `get`
20-
* `head`
21-
* `lock`
22-
* `merge`
23-
* `mkactivity`
24-
</td>
25-
<td style="background: none; border: 0px;" markdown="1">
26-
* `mkcol`
27-
* `move`
28-
* `m-search`
29-
* `notify`
30-
* `options`
31-
* `patch`
32-
* `post`
33-
</td>
34-
<td style="background: none; border: 0px;" markdown="1">
35-
* `purge`
36-
* `put`
37-
* `report`
38-
* `search`
39-
* `subscribe`
40-
* `trace`
41-
* `unlock`
42-
* `unsubscribe`
43-
</td>
44-
</tr>
45-
</table>
13+
<div class="methods-columns">
14+
<ul>
15+
<li><code>checkout</code></li>
16+
<li><code>copy</code></li>
17+
<li><code>delete</code></li>
18+
<li><code>get</code></li>
19+
<li><code>head</code></li>
20+
<li><code>lock</code></li>
21+
<li><code>merge</code></li>
22+
<li><code>mkactivity</code></li>
23+
</ul>
24+
<ul>
25+
<li><code>mkcol</code></li>
26+
<li><code>move</code></li>
27+
<li><code>m-search</code></li>
28+
<li><code>notify</code></li>
29+
<li><code>options</code></li>
30+
<li><code>patch</code></li>
31+
<li><code>post</code></li>
32+
</ul>
33+
<ul>
34+
<li><code>purge</code></li>
35+
<li><code>put</code></li>
36+
<li><code>report</code></li>
37+
<li><code>search</code></li>
38+
<li><code>subscribe</code></li>
39+
<li><code>trace</code></li>
40+
<li><code>unlock</code></li>
41+
<li><code>unsubscribe</code></li>
42+
</ul>
43+
</div>
4644

4745
The API documentation has explicit entries only for the most popular HTTP methods `app.get()`,
4846
`app.post()`, `app.put()`, and `app.delete()`.

_includes/api/en/4x/app-settings.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,15 @@ Exceptions: Sub-apps will inherit the value of `trust proxy` even though it has
99
Sub-apps will not inherit the value of `view cache` in production (when `NODE_ENV` is "production").
1010

1111
<div class="table-scroller">
12-
<table class="doctable" border="1">
13-
<thead><tr><th id="app-settings-property">Property</th><th>Type</th><th>Description</th><th>Default</th></tr></thead>
12+
<table>
13+
<thead>
14+
<tr>
15+
<th id="app-settings-property">Property</th>
16+
<th>Type</th>
17+
<th>Description</th>
18+
<th>Default</th>
19+
</tr>
20+
</thead>
1421
<tbody>
1522
<tr>
1623
<td markdown="1">
@@ -193,6 +200,7 @@ A custom query string parsing function will receive the complete query string, a
193200
</tr>
194201
</tbody>
195202
</table>
203+
</div>
196204

197205
<h5 id="trust.proxy.options.table">Options for `trust proxy` setting</h5>
198206

@@ -201,7 +209,8 @@ A custom query string parsing function will receive the complete query string, a
201209
information.
202210
</p>
203211

204-
<table class="doctable" border="1">
212+
<div class="table-scroller">
213+
<table>
205214
<thead><tr><th>Type</th><th>Value</th></tr></thead>
206215
<tbody>
207216
<tr>
@@ -271,6 +280,7 @@ app.set('trust proxy', function (ip) {
271280
</tr>
272281
</tbody>
273282
</table>
283+
</div>
274284

275285
<h5 id="etag.options.table">Options for `etag` setting</h5>
276286

@@ -285,7 +295,8 @@ The [express.static](#express.static) middleware ignores these settings.
285295
For more information, see its documentation.
286296
</p>
287297

288-
<table class="doctable" border="1">
298+
<div class="table-scroller">
299+
<table>
289300
<thead><tr><th>Type</th><th>Value</th></tr></thead>
290301
<tbody>
291302
<tr>

_includes/api/en/4x/app-use.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ The following table provides some simple examples of valid `path` values for
6666
mounting middleware.
6767

6868
<div class="table-scroller">
69-
<table class="doctable" border="1">
69+
<table>
7070

7171
<thead>
7272
<tr>
@@ -166,7 +166,7 @@ app.use(['/abcd', '/xyza', /\/lmn|\/pqr/], function (req, res, next) {
166166
The following table provides some simple examples of middleware functions that
167167
can be used as the `callback` argument to `app.use()`, `app.METHOD()`, and `app.all()`.
168168

169-
<table class="doctable" border="1">
169+
<table>
170170

171171
<thead>
172172
<tr>
@@ -282,6 +282,7 @@ app.use(mw1, [mw2, r1, r2], subApp)
282282
</tbody>
283283

284284
</table>
285+
</div>
285286

286287
Following are some examples of using the [express.static](/{{page.lang}}/guide/using-middleware.html#middleware.built-in)
287288
middleware in an Express app.

_includes/api/en/4x/express.json.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ For example, `req.body.foo.toString()` may fail in multiple ways, for example
2626
function and instead a string or other user-input.
2727
</div>
2828

29+
<div class="table-scroller" markdown="1">
30+
2931
The following table describes the properties of the optional `options` object.
3032

3133
| Property | Description | Type | Default |
@@ -36,3 +38,5 @@ The following table describes the properties of the optional `options` object.
3638
| `strict` | Enables or disables only accepting arrays and objects; when disabled will accept anything `JSON.parse` accepts. | Boolean | `true` |
3739
| `type` | This is used to determine what media type the middleware will parse. This option can be a string, array of strings, or a function. If not a function, `type` option is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `json`), a mime type (like `application/json`), or a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type` option is called as `fn(req)` and the request is parsed if it returns a truthy value. | Mixed | `"application/json"` |
3840
| `verify` | This option, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. | Function | `undefined` |
41+
42+
</div>

_includes/api/en/4x/express.raw.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ that `req.body` is a `Buffer` before calling buffer methods is recommended.
2828

2929
The following table describes the properties of the optional `options` object.
3030

31+
<div class="table-scroller" markdown="1">
32+
3133
| Property | Description | Type | Default |
3234
|-----------|-----------------------------------------------------------------------|-------------|-----------------|
3335
| `inflate` | Enables or disables handling deflated (compressed) bodies; when disabled, deflated bodies are rejected. | Boolean | `true` |
3436
| `limit` | Controls the maximum request body size. If this is a number, then the value specifies the number of bytes; if it is a string, the value is passed to the [bytes](https://www.npmjs.com/package/bytes) library for parsing. | Mixed | `"100kb"` |
3537
| `type` | This is used to determine what media type the middleware will parse. This option can be a string, array of strings, or a function. If not a function, `type` option is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `bin`), a mime type (like `application/octet-stream`), or a mime type with a wildcard (like `*/*` or `application/*`). If a function, the `type` option is called as `fn(req)` and the request is parsed if it returns a truthy value. | Mixed | `"application/octet-stream"` |
3638
| `verify` | This option, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. | Function | `undefined` |
39+
40+
</div>

_includes/api/en/4x/express.static.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ to move on to the next middleware, allowing for stacking and fall-backs.
1616
The following table describes the properties of the `options` object.
1717
See also the [example below](#example.of.express.static).
1818

19+
<div class="table-scroller" markdown="1">
20+
1921
| Property | Description | Type | Default |
2022
|---------------|-----------------------------------------------------------------------|-------------|-----------------|
2123
| `dotfiles` | Determines how dotfiles (files or directories that begin with a dot ".") are treated. <br/><br/>See [dotfiles](#dotfiles) below. | String | `undefined` |
@@ -29,6 +31,8 @@ See also the [example below](#example.of.express.static).
2931
| `redirect` | Redirect to trailing "/" when the pathname is a directory. | Boolean | `true` |
3032
| `setHeaders` | Function for setting HTTP headers to serve with the file. <br/><br/>See [setHeaders](#setHeaders) below. | Function | |
3133

34+
</div>
35+
3236
For more information, see [Serving static files in Express](/starter/static-files.html).
3337
and [Using middleware - Built-in middleware](/{{page.lang}}/guide/using-middleware.html#middleware.built-in).
3438

_includes/api/en/4x/express.text.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ that `req.body` is a string before calling string methods is recommended.
2828

2929
The following table describes the properties of the optional `options` object.
3030

31+
<div class="table-scroller" markdown="1">
32+
3133
| Property | Description | Type | Default |
3234
|------------------|-----------------------------------------------------------------------|-------------|-----------------|
3335
| `defaultCharset` | Specify the default character set for the text content if the charset is not specified in the `Content-Type` header of the request. | String | `"utf-8"` |
3436
| `inflate` | Enables or disables handling deflated (compressed) bodies; when disabled, deflated bodies are rejected. | Boolean | `true` |
3537
| `limit` | Controls the maximum request body size. If this is a number, then the value specifies the number of bytes; if it is a string, the value is passed to the [bytes](https://www.npmjs.com/package/bytes) library for parsing. | Mixed | `"100kb"` |
3638
| `type` | This is used to determine what media type the middleware will parse. This option can be a string, array of strings, or a function. If not a function, `type` option is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `txt`), a mime type (like `text/plain`), or a mime type with a wildcard (like `*/*` or `text/*`). If a function, the `type` option is called as `fn(req)` and the request is parsed if it returns a truthy value. | Mixed | `"text/plain"` |
3739
| `verify` | This option, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. | Function | `undefined` |
40+
41+
</div>

_includes/api/en/4x/express.urlencoded.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ function and instead a string or other user-input.
2929

3030
The following table describes the properties of the optional `options` object.
3131

32+
<div class="table-scroller" markdown="1">
33+
3234
| Property | Description | Type | Default |
3335
|------------------|-----------------------------------------------------------------------|-------------|-----------------|
3436
| `extended` | This option allows to choose between parsing the URL-encoded data with the `querystring` library (when `false`) or the `qs` library (when `true`). The "extended" syntax allows for rich objects and arrays to be encoded into the URL-encoded format, allowing for a JSON-like experience with URL-encoded. For more information, please [see the qs library](https://www.npmjs.org/package/qs#readme). | Boolean | `true` |
@@ -37,3 +39,5 @@ The following table describes the properties of the optional `options` object.
3739
| `parameterLimit` | This option controls the maximum number of parameters that are allowed in the URL-encoded data. If a request contains more parameters than this value, an error will be raised. | Number | `1000` |
3840
| `type` | This is used to determine what media type the middleware will parse. This option can be a string, array of strings, or a function. If not a function, `type` option is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `urlencoded`), a mime type (like `application/x-www-form-urlencoded`), or a mime type with a wildcard (like `*/x-www-form-urlencoded`). If a function, the `type` option is called as `fn(req)` and the request is parsed if it returns a truthy value. | Mixed | `"application/x-www-form-urlencoded"` |
3941
| `verify` | This option, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. | Function | `undefined` |
42+
43+
</div>

_includes/api/en/4x/req-range.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ The `size` parameter is the maximum size of the resource.
66

77
The `options` parameter is an object that can have the following properties.
88

9+
<div class="table-scroller" markdown="1">
10+
911
| Property | Type | Description |
1012
|-------------|-------------------------------------------------------------------------|
11-
| `combine` | Boolean | Specify if overlapping & adjacent ranges should be combined, defaults to `false`. When `true`, ranges will be combined and returned as if they were specified that way in the header.
13+
| `combine` | Boolean | Specify if overlapping & adjacent ranges should be combined, defaults to `false`. When `true`, ranges will be combined and returned as if they were specified that way in the header.|
14+
15+
</div>
1216

1317
An array of ranges will be returned or negative numbers indicating an error parsing.
1418

_includes/api/en/4x/res-cookie.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,23 @@ Sets cookie `name` to `value`. The `value` parameter may be a string or object
44

55
The `options` parameter is an object that can have the following properties.
66

7+
<div class="table-scroller" markdown="1">
8+
79
| Property | Type | Description |
810
|---------------|-------------------------------------------------------------------------|
9-
| `domain` | String | Domain name for the cookie. Defaults to the domain name of the app.
10-
| `encode` | Function | A synchronous function used for cookie value encoding. Defaults to `encodeURIComponent`.
11-
| `expires` | Date | Expiry date of the cookie in GMT. If not specified or set to 0, creates a session cookie.
12-
| `httpOnly` | Boolean | Flags the cookie to be accessible only by the web server.
13-
| `maxAge` | Number | Convenient option for setting the expiry time relative to the current time in milliseconds.
14-
| `path` | String | Path for the cookie. Defaults to "/".
15-
| `partitioned` | Boolean | Indicates that the cookie should be stored using partitioned storage. See [Cookies Having Independent Partitioned State (CHIPS)](https://developer.mozilla.org/en-US/docs/Web/Privacy/Partitioned_cookies) for more details.
16-
| `priority` | String | Value of the "Priority" **Set-Cookie** attribute.
17-
| `secure` | Boolean | Marks the cookie to be used with HTTPS only.
18-
| `signed` | Boolean | Indicates if the cookie should be signed.
19-
| `sameSite` | Boolean or String | Value of the "SameSite" **Set-Cookie** attribute. More information at [https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1).
11+
| `domain` | String | Domain name for the cookie. Defaults to the domain name of the app.|
12+
| `encode` | Function | A synchronous function used for cookie value encoding. Defaults to `encodeURIComponent`.|
13+
| `expires` | Date | Expiry date of the cookie in GMT. If not specified or set to 0, creates a session cookie.|
14+
| `httpOnly` | Boolean | Flags the cookie to be accessible only by the web server.|
15+
| `maxAge` | Number | Convenient option for setting the expiry time relative to the current time in milliseconds.|
16+
| `path` | String | Path for the cookie. Defaults to "/".|
17+
| `partitioned` | Boolean | Indicates that the cookie should be stored using partitioned storage. See [Cookies Having Independent Partitioned State (CHIPS)](https://developer.mozilla.org/en-US/docs/Web/Privacy/Partitioned_cookies) for more details.|
18+
| `priority` | String | Value of the "Priority" **Set-Cookie** attribute.|
19+
| `secure` | Boolean | Marks the cookie to be used with HTTPS only.|
20+
| `signed` | Boolean | Indicates if the cookie should be signed.|
21+
| `sameSite` | Boolean or String | Value of the "SameSite" **Set-Cookie** attribute. More information at [https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1).|
22+
23+
</div>
2024

2125
<div class="doc-box doc-notice" markdown="1">
2226
All `res.cookie()` does is set the HTTP `Set-Cookie` header with the options provided.

0 commit comments

Comments
 (0)