Skip to content

Commit d523d04

Browse files
authored
Merge branch 'cloudflare:production' into feature/content-version-management-system
2 parents 9b724ae + 1408006 commit d523d04

File tree

187 files changed

+2091
-271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+2091
-271
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203

204204
# Support
205205

206-
/src/content/docs/support/ @shanecloudflare @zeinjaber @TracyCloudflare @ngayerie @cloudflare/pcx-technical-writing
206+
/src/content/docs/support/ @shanecloudflare @zeinjaber @TracyCloudflare @ngayerie @cloudflare/pcx-technical-writing @cloudflare/customer-support
207207

208208
# Turnstile
209209

CONTRIBUTING.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,46 @@ If we require more information to address your pull request, the `more-informati
3333
- [npm](https://nodejs.org/en/learn/getting-started/an-introduction-to-the-npm-package-manager#introduction-to-npm) is the recommended package manager that must be used in installing dependencies.
3434
- The generated `package-lock.json` file must be committed to git.
3535

36+
## Wrangler config
37+
38+
If you're adding a code snippet to the docs that represents a Wrangler config file (`wrangler.toml` or `wrangler.json`) make sure you wrap it with the `<WranglerConfig>` component, which ensure it's rendered as both JSON and TOML e.g.
39+
40+
````
41+
42+
import { WranglerConfig } from "~/components";
43+
44+
<WranglerConfig>
45+
46+
```toml
47+
# Top-level configuration
48+
name = "my-worker"
49+
main = "src/index.js"
50+
compatibility_date = "2022-07-12"
51+
52+
workers_dev = false
53+
route = { pattern = "example.org/*", zone_name = "example.org" }
54+
55+
kv_namespaces = [
56+
{ binding = "<MY_NAMESPACE>", id = "<KV_ID>" }
57+
]
58+
59+
[env.staging]
60+
name = "my-worker-staging"
61+
route = { pattern = "staging.example.org/*", zone_name = "example.org" }
62+
63+
kv_namespaces = [
64+
{ binding = "<MY_NAMESPACE>", id = "<STAGING_KV_ID>" }
65+
]
66+
```
67+
68+
</WranglerConfig>
69+
70+
````
3671

3772
## Workers Playground
73+
3874
If you are adding a code snippet to the docs that is:
75+
3976
1. A fully contained, valid Worker (i.e. it does not require external dependencies or specific bindings)
4077
2. Only JavaScript
4178

@@ -58,6 +95,7 @@ export default {
5895
};
5996
```
6097
````
98+
6199
would render as
62100

63101
<img width="870" alt="Screenshot 2024-02-20 at 14 29 22" src="https://github.com/cloudflare/cloudflare-docs/assets/28503158/56aa8016-b3b6-4d64-8213-b1a26f16534a">

package-lock.json

Lines changed: 21 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"@cloudflare/workers-types": "^4.20241112.0",
4040
"@codingheads/sticky-header": "^1.0.2",
4141
"@iconify-json/material-symbols": "^1.2.8",
42+
"@iarna/toml": "^2.2.5",
4243
"@stoplight/json-schema-tree": "^4.0.0",
4344
"@types/dompurify": "^3.2.0",
4445
"@types/hast": "^3.0.4",
@@ -61,14 +62,15 @@
6162
"he": "^1.2.0",
6263
"instantsearch.css": "^8.5.1",
6364
"instantsearch.js": "^4.75.4",
65+
"jsonc-parser": "^3.3.1",
6466
"lz-string": "^1.5.0",
6567
"marked": "^15.0.2",
6668
"mdast-util-mdx-expression": "^2.0.1",
6769
"mermaid": "^11.4.0",
6870
"node-html-parser": "^6.1.13",
6971
"patch-package": "^8.0.0",
7072
"playwright": "^1.49.0",
71-
"prettier": "^3.3.3",
73+
"prettier": "^3.4.1",
7274
"prettier-plugin-astro": "^0.14.1",
7375
"puppeteer": "^23.9.0",
7476
"react": "^18.3.1",
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
import { parse } from "node-html-parser";
3+
import { Code, Tabs, TabItem } from "@astrojs/starlight/components";
4+
import TOML from "@iarna/toml";
5+
import { parse as jsoncParse } from "jsonc-parser";
6+
7+
const slot = await Astro.slots.render("default");
8+
9+
const html = parse(slot);
10+
11+
const copy = html.querySelector("div.copy > button");
12+
13+
if (!copy) {
14+
throw new Error(
15+
`[WranglerConfig] Unable to find copy button in rendered code block HTML.`,
16+
);
17+
}
18+
19+
let code = copy.attributes["data-code"];
20+
21+
if (!code) {
22+
throw new Error(
23+
`[WranglerConfig] Unable to find data-code attribute on copy button.`,
24+
);
25+
}
26+
27+
code = code.replace(/\u007f/g, "\n");
28+
29+
const language =
30+
html.querySelector("[data-language]")?.attributes["data-language"];
31+
32+
if (!language) {
33+
throw new Error(`[WranglerConfig] Unable to find data-language.`);
34+
}
35+
36+
let toml, json;
37+
38+
if (language === "toml") {
39+
toml = code;
40+
json = JSON.stringify(TOML.parse(code), null, 2);
41+
} else {
42+
json = code;
43+
toml = TOML.stringify(jsoncParse(code));
44+
}
45+
---
46+
47+
<Tabs syncKey="wranglerConfig">
48+
<TabItem label="wrangler.toml" icon="setting">
49+
<Code lang="toml" code={toml} />
50+
</TabItem>
51+
<TabItem label="wrangler.json" icon="seti:json">
52+
<Code lang="jsonc" code={json} />
53+
</TabItem>
54+
</Tabs>

src/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export { default as TroubleshootingList } from "./TroubleshootingList.astro";
5353
export { default as TunnelCalculator } from "./TunnelCalculator.astro";
5454
export { default as Type } from "./Type.astro";
5555
export { default as TypeScriptExample } from "./TypeScriptExample.astro";
56+
export { default as WranglerConfig } from "./WranglerConfig.astro";
5657
export { default as WorkersArchitectureDiagram } from "./WorkersArchitectureDiagram.astro";
5758
export { default as WorkersIsolateDiagram } from "./WorkersIsolateDiagram.astro";
5859
export { default as WorkerStarter } from "./WorkerStarter.astro";

src/content/changelogs/dlp.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ productLink: "/cloudflare-one/policies/data-loss-prevention/"
55
productArea: Cloudflare One
66
productAreaLink: /cloudflare-one/changelog/
77
entries:
8+
- publish_date: "2024-11-25"
9+
title: Profile confidence levels
10+
description: |-
11+
DLP profiles now support setting a [confidence level](/cloudflare-one/policies/data-loss-prevention/dlp-profiles/advanced-settings/#confidence-levels) to choose how tolerant its detections are to false positives based on the context of the detection. The higher a profile's confidence level is, the less false positives will be allowed. Confidence levels include Low, Medium, or High. DLP profile confidence levels supersede [context analysis](/cloudflare-one/policies/data-loss-prevention/dlp-profiles/advanced-settings/#context-analysis).
812
- publish_date: "2024-11-01"
913
title: Send entire HTTP requests to a Logpush destination
1014
description: |-

src/content/docs/1.1.1.1/infrastructure/extended-dns-error-codes.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
pcx_content_type: reference
33
title: Extended DNS error codes
4+
sidebar:
5+
order: 4
46
slug: 1.1.1.1/infrastructure/extended-dns-error-codes
5-
67
---
78

89

src/content/docs/1.1.1.1/infrastructure/ipv6-networks.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
pcx_content_type: reference
33
title: Support for IPv6-only networks
4+
sidebar:
5+
order: 3
46
slug: 1.1.1.1/infrastructure/ipv6-networks
5-
67
---
78

89
While network infrastructure is shifting towards IPv6-only networks, providers still need to support IPv4 addresses. Dual-stack networks are networks in which all nodes have both IPv4 and IPv6 connectivity capabilities, and can therefore understand both IPv4 and IPv6 packets.

src/content/docs/1.1.1.1/infrastructure/network-operators.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
pcx_content_type: reference
33
title: Network operators
4+
sidebar:
5+
order: 1
46
slug: 1.1.1.1/infrastructure/network-operators
5-
67
---
78

89
Network operators, including Internet Service Providers (ISPs), device manufacturers, public Wi-Fi networks, municipal broadband providers, and security scanning services can use [1.1.1.1](/1.1.1.1/setup/) in place of operating their own recursive DNS infrastructure.

0 commit comments

Comments
 (0)