Skip to content

Commit 410659b

Browse files
pedrosousaOxyjun
andauthored
[Docs] Update overview pages (#18710)
--------- Co-authored-by: Jun Lee <[email protected]>
1 parent 19d1e26 commit 410659b

File tree

10 files changed

+155
-103
lines changed

10 files changed

+155
-103
lines changed

src/content/docs/browser-rendering/faq.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ const innerHtml = await page.evaluate(() => {
4747

4848
Keep in mind that `page.evaluate` can only return primitive types like strings, numbers, etc.
4949

50-
Returning an `HTMLElement` won't work.
50+
Returning an `HTMLElement` will not work.
5151

5252
:::

src/content/docs/browser-rendering/get-started/index.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ pcx_content_type: navigation
33
title: Get started
44
sidebar:
55
order: 2
6-
6+
group:
7+
hideIndex: true
78
---
89

9-
import { DirectoryListing } from "~/components"
10+
import { DirectoryListing } from "~/components";
1011

1112
<DirectoryListing />

src/content/docs/browser-rendering/how-to/pdf-generation.mdx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ npm install @cloudflare/puppeteer --save-dev
2525

2626
3. Add your Browser Rendering binding to your new `wrangler.toml` configuration:
2727

28-
```yaml
28+
```toml
2929
browser = { binding = "BROWSER" }
3030
```
3131

@@ -66,15 +66,12 @@ export default {
6666
Rather than using Browser Rendering to navigate to a user-provided URL, manually generate a webpage, then provide that webpage to the Browser Rendering instance. This allows you to render any design you want.
6767

6868
:::note
69-
It's worth noting that you can generate your HTML or CSS using any method
70-
you'd like. For now we're using string interpolation, but this method is
71-
fully-compatible with web frameworks capable of rendering HTML on Workers such
72-
as React, Remix, and Vue.
69+
You can generate your HTML or CSS using any method you like. This example uses string interpolation, but the method is also fully compatible with web frameworks capable of rendering HTML on Workers such as React, Remix, and Vue.
7370
:::
7471

7572
For this example, we're going to take in user-provided content (via a '?name=' parameter), and have that name output in the final PDF document.
7673

77-
To start, let's fill out your 'generateDocument' function with the following:
74+
To start, fill out your `generateDocument` function with the following:
7875

7976
```ts
8077
const generateDocument = (name: string) => {
@@ -128,11 +125,7 @@ const generateDocument = (name: string) => {
128125
This example HTML document should render a beige background imitating a certificate showing that the user-provided name has successfully rendered a PDF using Cloudflare Workers.
129126

130127
:::note
131-
It's usually best to avoid directly interpolating user-provided content into
132-
an image or PDF renderer in production applications. To render contents like
133-
an invoice, it wold be best to validate the data input, and fetch data
134-
yourself using tools like [D1](/d1/) or
135-
[Workers KV](/kv/).
128+
It is usually best to avoid directly interpolating user-provided content into an image or PDF renderer in production applications. To render contents like an invoice, it would be best to validate the data input and fetch the data yourself using tools like [D1](/d1/) or [Workers KV](/kv/).
136129
:::
137130

138131
## 2. Load HTML and CSS Into Browser
Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
---
2-
title: Overview
2+
title: Browser Rendering
33
pcx_content_type: overview
44
sidebar:
55
order: 1
66
head:
77
- tag: title
88
content: Browser Rendering
9-
109
---
1110

12-
import { CardGrid, Description, LinkTitleCard, Plan, RelatedProduct } from "~/components"
11+
import {
12+
CardGrid,
13+
Description,
14+
LinkTitleCard,
15+
Plan,
16+
RelatedProduct,
17+
} from "~/components";
1318

1419
<Description>
1520

1621
Browser automation for [Cloudflare Workers](/workers/).
22+
1723
</Description>
1824

1925
<Plan type="workers-paid" />
@@ -22,50 +28,67 @@ The Workers Browser Rendering API allows developers to programmatically control
2228

2329
Use Browser Rendering to:
2430

25-
* Take screenshots of pages.
26-
* Convert a page to a PDF.
27-
* Test web applications.
28-
* Gather page load performance metrics.
29-
* Crawl web pages for information retrieval.
31+
- Take screenshots of pages.
32+
- Convert a page to a PDF.
33+
- Test web applications.
34+
- Gather page load performance metrics.
35+
- Crawl web pages for information retrieval.
3036

3137
## Related products
3238

3339
<RelatedProduct header="Workers" href="/workers/" product="workers">
3440

3541
Build serverless applications and deploy instantly across the globe for exceptional performance, reliability, and scale.
3642

37-
3843
</RelatedProduct>
3944

4045
<RelatedProduct header="Durable Objects" href="/durable-objects/" product="durable-objects">
4146

4247
A globally distributed coordination API with strongly consistent storage.
4348

44-
4549
</RelatedProduct>
4650

4751
## More resources
4852

4953
<CardGrid>
5054

51-
<LinkTitleCard title="Get started" href="/browser-rendering/get-started/" icon="open-book">
52-
Deploy your first Browser Rendering project using Wrangler and Cloudflare's version of Puppeteer.
55+
<LinkTitleCard
56+
title="Get started"
57+
href="/browser-rendering/get-started/"
58+
icon="open-book"
59+
>
60+
Deploy your first Browser Rendering project using Wrangler and Cloudflare's
61+
version of Puppeteer.
5362
</LinkTitleCard>
5463

5564
<LinkTitleCard title="Learning Path" href="/learning-paths/workers/" icon="pen">
56-
New to Workers? Get started with the Workers Learning Path.
65+
New to Workers? Get started with the Workers Learning Path.
5766
</LinkTitleCard>
5867

59-
<LinkTitleCard title="Limits" href="/browser-rendering/platform/limits/" icon="document">
60-
Learn about Browser Rendering limits.
68+
<LinkTitleCard
69+
title="Limits"
70+
href="/browser-rendering/platform/limits/"
71+
icon="document"
72+
>
73+
Learn about Browser Rendering limits.
6174
</LinkTitleCard>
6275

63-
<LinkTitleCard title="Developer Discord" href="https://discord.cloudflare.com" icon="discord">
64-
Connect with the Workers community on Discord to ask questions, show what you are building, and discuss the platform with other developers.
76+
<LinkTitleCard
77+
title="Developer Discord"
78+
href="https://discord.cloudflare.com"
79+
icon="discord"
80+
>
81+
Connect with the Workers community on Discord to ask questions, show what you
82+
are building, and discuss the platform with other developers.
6583
</LinkTitleCard>
6684

67-
<LinkTitleCard title="@CloudflareDev" href="https://x.com/cloudflaredev" icon="x.com">
68-
Follow @CloudflareDev on Twitter to learn about product announcements, and what is new in Cloudflare Workers.
85+
<LinkTitleCard
86+
title="@CloudflareDev"
87+
href="https://x.com/cloudflaredev"
88+
icon="x.com"
89+
>
90+
Follow @CloudflareDev on Twitter to learn about product announcements, and
91+
what is new in Cloudflare Workers.
6992
</LinkTitleCard>
7093

7194
</CardGrid>

src/content/docs/browser-rendering/platform/index.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ pcx_content_type: navigation
33
title: Platform
44
sidebar:
55
order: 3
6-
6+
group:
7+
hideIndex: true
78
---
89

9-
import { DirectoryListing } from "~/components"
10+
import { DirectoryListing } from "~/components";
1011

1112
<DirectoryListing />

src/content/docs/browser-rendering/platform/puppeteer.mdx

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The Workers team forked a version of Puppeteer and patched it to connect to the
1515

1616
Our version is open sourced and can be found in [Cloudflare's fork of Puppeteer](https://github.com/cloudflare/puppeteer). The npm can be installed from [npmjs](https://www.npmjs.com/) as [@cloudflare/puppeteer](https://www.npmjs.com/package/@cloudflare/puppeteer):
1717

18-
```javascript
18+
```bash
1919
npm install @cloudflare/puppeteer --save-dev
2020
```
2121

@@ -83,18 +83,18 @@ In order to facilitate browser session management, we've added new methods to `p
8383

8484
`puppeteer.sessions()` lists the current running sessions. It will return an output similar to this:
8585

86-
```
86+
```json
8787
[
88-
{
89-
"connectionId": "2a2246fa-e234-4dc1-8433-87e6cee80145",
90-
"connectionStartTime": 1711621704607,
91-
"sessionId": "478f4d7d-e943-40f6-a414-837d3736a1dc",
92-
"startTime": 1711621703708
93-
},
94-
{
95-
"sessionId": "565e05fb-4d2a-402b-869b-5b65b1381db7",
96-
"startTime": 1711621703808
97-
}
88+
{
89+
"connectionId": "2a2246fa-e234-4dc1-8433-87e6cee80145",
90+
"connectionStartTime": 1711621704607,
91+
"sessionId": "478f4d7d-e943-40f6-a414-837d3736a1dc",
92+
"startTime": 1711621703708
93+
},
94+
{
95+
"sessionId": "565e05fb-4d2a-402b-869b-5b65b1381db7",
96+
"startTime": 1711621703808
97+
}
9898
]
9999
```
100100

@@ -104,22 +104,22 @@ Notice that the session `478f4d7d-e943-40f6-a414-837d3736a1dc` has an active wor
104104

105105
`puppeteer.history()` lists recent sessions, both open and closed. It's useful to get a sense of your current usage.
106106

107-
```
107+
```json
108108
[
109-
{
110-
"closeReason": 2,
111-
"closeReasonText": "BrowserIdle",
112-
"endTime": 1711621769485,
113-
"sessionId": "478f4d7d-e943-40f6-a414-837d3736a1dc",
114-
"startTime": 1711621703708
115-
},
116-
{
117-
"closeReason": 1,
118-
"closeReasonText": "NormalClosure",
119-
"endTime": 1711123501771,
120-
"sessionId": "2be00a21-9fb6-4bb2-9861-8cd48e40e771",
121-
"startTime": 1711123430918
122-
}
109+
{
110+
"closeReason": 2,
111+
"closeReasonText": "BrowserIdle",
112+
"endTime": 1711621769485,
113+
"sessionId": "478f4d7d-e943-40f6-a414-837d3736a1dc",
114+
"startTime": 1711621703708
115+
},
116+
{
117+
"closeReason": 1,
118+
"closeReasonText": "NormalClosure",
119+
"endTime": 1711123501771,
120+
"sessionId": "2be00a21-9fb6-4bb2-9861-8cd48e40e771",
121+
"startTime": 1711123430918
122+
}
123123
]
124124
```
125125

@@ -131,12 +131,15 @@ You should also be able to access this information in the dashboard, albeit with
131131

132132
`puppeteer.limits()` lists your active limits:
133133

134-
```
134+
```json
135135
{
136-
"activeSessions": ["478f4d7d-e943-40f6-a414-837d3736a1dc", "565e05fb-4d2a-402b-869b-5b65b1381db7"],
137-
"allowedBrowserAcquisitions": 1,
138-
"maxConcurrentSessions": 2,
139-
"timeUntilNextAllowedBrowserAcquisition": 0
136+
"activeSessions": [
137+
"478f4d7d-e943-40f6-a414-837d3736a1dc",
138+
"565e05fb-4d2a-402b-869b-5b65b1381db7"
139+
],
140+
"allowedBrowserAcquisitions": 1,
141+
"maxConcurrentSessions": 2,
142+
"timeUntilNextAllowedBrowserAcquisition": 0
140143
}
141144
```
142145

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
---
2-
title: Overview
2+
title: Cloudflare Firewall Rules
33
pcx_content_type: overview
44
sidebar:
55
order: 1
66
badge:
77
text: Deprecated
88
head:
99
- tag: title
10-
content: Cloudflare Firewall Rules
11-
10+
content: Cloudflare Firewall Rules (deprecated)
1211
---
1312

14-
import { FeatureTable, Render } from "~/components"
13+
import { FeatureTable, Render } from "~/components";
1514

1615
Cloudflare Firewall Rules allows you to create rules that inspect incoming traffic and block, challenge, log, or allow specific requests.
1716

1817
<Render file="deprecation-notice" />
1918

2019
## Main features
2120

22-
* **Rule-based protection**: Use pre-defined rulesets provided by Cloudflare, or define your own firewall rules. Create rules in the Cloudflare dashboard or via API.
23-
* **Complex custom rules**: Each rule's expression can reference multiple fields from all the available HTTP request parameters and fields, allowing you to create complex rules.
21+
- **Rule-based protection**: Use pre-defined rulesets provided by Cloudflare, or define your own firewall rules. Create rules in the Cloudflare dashboard or via API.
22+
- **Complex custom rules**: Each rule's expression can reference multiple fields from all the available HTTP request parameters and fields, allowing you to create complex rules.
2423

2524
## Availability
2625

@@ -30,15 +29,15 @@ This table outlines the Firewall Rules features and entitlements available with
3029

3130
## Next steps
3231

33-
* Unless you are already an advanced user, refer to [Expressions](/ruleset-engine/rules-language/expressions/) and [Actions](/firewall/cf-firewall-rules/actions/) to learn more about the basic elements of firewall rules.
32+
- Unless you are already an advanced user, refer to [Expressions](/ruleset-engine/rules-language/expressions/) and [Actions](/firewall/cf-firewall-rules/actions/) to learn more about the basic elements of firewall rules.
3433

35-
* To start building your own firewall rules, refer to one of the following pages:
34+
- To start building your own firewall rules, refer to one of the following pages:
3635

37-
* [Manage firewall rules in the dashboard](/firewall/cf-dashboard/create-edit-delete-rules/)
38-
* [Manage firewall rules via the APIs](/firewall/api/)
36+
- [Manage firewall rules in the dashboard](/firewall/cf-dashboard/create-edit-delete-rules/)
37+
- [Manage firewall rules via the APIs](/firewall/api/)
3938

40-
* You can also manage firewall rules through Terraform. For more information, refer to [Getting Started with Terraform](https://blog.cloudflare.com/getting-started-with-terraform-and-cloudflare-part-1/).
39+
- You can also manage firewall rules through Terraform. For more information, refer to [Getting Started with Terraform](https://blog.cloudflare.com/getting-started-with-terraform-and-cloudflare-part-1/).
4140

4241
## Related resources
4342

44-
* [Cloudflare Rules language](/ruleset-engine/rules-language/)
43+
- [Cloudflare Rules language](/ruleset-engine/rules-language/)

src/content/docs/firewall/troubleshooting/index.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ pcx_content_type: navigation
33
title: Troubleshooting
44
sidebar:
55
order: 5
6-
6+
group:
7+
hideIndex: true
78
---
89

9-
import { DirectoryListing } from "~/components"
10+
import { DirectoryListing } from "~/components";
1011

1112
The following topics are useful for troubleshooting firewall issues.
1213

0 commit comments

Comments
 (0)