Skip to content

Commit 2a75518

Browse files
authored
[Fundamentals / Docs site] Expand page options dropdown + add fundamentals page on AI tooling (#25832)
* [Fundamentals / Docs site] Expand page options dropdown + add fundamentals page on AI tooling * update location
1 parent 99c717e commit 2a75518

File tree

5 files changed

+121
-17
lines changed

5 files changed

+121
-17
lines changed
49.1 KB
Loading

src/components/CopyPageButton.tsx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import {
1616
PiCheckCircleLight,
1717
PiXCircleLight,
1818
PiChatCircleLight,
19+
PiLinkLight,
20+
PiPlugsConnectedLight,
1921
} from "react-icons/pi";
2022
import ClaudeIcon from "./icons/ClaudeIcon";
2123
import ChatGPTIcon from "./icons/ChatGPTIcon";
@@ -58,6 +60,14 @@ export default function CopyPageButton() {
5860
window.open(docsAIUrl, "_blank");
5961
};
6062

63+
const handleViewAIOptions = () => {
64+
const aiOptionsUrl = "/style-guide/ai-tooling/";
65+
track("clicked copy page button", {
66+
value: "view ai options",
67+
});
68+
window.open(aiOptionsUrl, "_blank");
69+
};
70+
6171
const handleExternalAI = (url: string, vendor: string) => {
6272
const externalAIURL = url;
6373
const indexMdUrl = new URL("index.md", window.location.href).toString();
@@ -99,7 +109,34 @@ export default function CopyPageButton() {
99109
}
100110
};
101111

112+
const handleCopyPageLink = async () => {
113+
try {
114+
await navigator.clipboard.writeText(window.location.href);
115+
track("clicked copy page button", {
116+
value: "copy page link",
117+
});
118+
119+
setCopyState("success");
120+
setTimeout(() => {
121+
setCopyState("idle");
122+
}, 1500);
123+
} catch (error) {
124+
console.error("Failed to copy page link:", error);
125+
126+
setCopyState("error");
127+
setTimeout(() => {
128+
setCopyState("idle");
129+
}, 1500);
130+
}
131+
};
132+
102133
const options = [
134+
{
135+
label: "Copy page link",
136+
description: "Copy the current page URL to clipboard",
137+
icon: PiLinkLight,
138+
onClick: handleCopyPageLink,
139+
},
103140
{
104141
label: "View Page as Markdown",
105142
description: "Open the Markdown file in a new tab",
@@ -119,6 +156,12 @@ export default function CopyPageButton() {
119156
onClick: () =>
120157
handleExternalAI("https://chat.openai.com/?prompt=", "chatgpt"),
121158
},
159+
{
160+
label: "View other AI options",
161+
description: "Explore more AI tooling options",
162+
icon: PiPlugsConnectedLight,
163+
onClick: handleViewAIOptions,
164+
},
122165
{
123166
label: "Ask Docs AI",
124167
description: "Open our Docs AI assistant in a new tab",
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
pcx_content_type: reference
3+
title: AI Tooling
4+
sidebar:
5+
order: 4
6+
---
7+
8+
import { Render, Tabs, TabItem } from "~/components";
9+
10+
Use the following AI tools to get the most out of Cloudflare (and our docs).
11+
12+
## llms.txt
13+
14+
<Render file="llms-txt" product="style-guide" />
15+
16+
## MCP
17+
18+
Cloudflare runs a catalog of managed remote MCP Servers which you can connect to using OAuth on clients like [Claude](https://modelcontextprotocol.io/quickstart/user), [Windsurf](https://docs.windsurf.com/windsurf/cascade/mcp), our own [AI Playground](https://playground.ai.cloudflare.com/) or any [SDK that supports MCP](https://github.com/cloudflare/agents/tree/main/packages/agents/src/mcp).
19+
20+
<Tabs>
21+
<TabItem label="Cursor">
22+
23+
To install in Cursor, use this [Direct install link](https://cursor.com/en-US/install-mcp?name=cloudflare&config=eyJjb21tYW5kIjoibnB4IG1jcC1yZW1vdGUgaHR0cHM6Ly9kb2NzLm1jcC5jbG91ZGZsYXJlLmNvbS9zc2UifQ%3D%3D).
24+
25+
</TabItem>
26+
<TabItem label="VSCode">
27+
28+
To install in VSCode, use this [Direct install link](vscode:mcp/install?%7B%22name%22%3A%22cloudflare%22%2C%22url%22%3A%22https%3A%2F%2Fdocs.mcp.cloudflare.com%2Fmcp%22%7D).
29+
30+
</TabItem>
31+
<TabItem label="Manually">
32+
33+
To install manually, add the following specification to your MCP config:
34+
35+
```json
36+
{
37+
"mcpServers": {
38+
"cloudflare": {
39+
"command": "npx",
40+
"args": ["mcp-remote", "https://docs.mcp.cloudflare.com/mcp"]
41+
}
42+
}
43+
}
44+
```
45+
46+
</TabItem>
47+
48+
</Tabs>
49+
50+
:::note
51+
52+
For other MCP servers offered by Cloudflare, refer to [Cloudflare's MCP servers](/agents/model-context-protocol/mcp-servers-for-cloudflare/).
53+
54+
:::

src/content/docs/style-guide/how-we-docs/ai-consumability.mdx

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,15 @@ meta:
55
title: AI consumability | How we docs
66
---
77

8-
import { Tabs, TabItem, Width } from "~/components";
8+
import { Tabs, TabItem, Render } from "~/components";
99

1010
We have various approaches for making our content visible to AI as well as making sure it's easily consumed in a plain-text format.
1111

1212
## AI discoverability
1313

1414
The primary proposal in this space is [`llms.txt`](https://llmstxt.org/), offering a well-known path for a Markdown list of all your pages.
1515

16-
We have implemented `llms.txt`, `llms-full.txt` and also created per-page Markdown links as follows:
17-
18-
- [`llms.txt`](/llms.txt)
19-
- [`llms-full.txt`](/llms-full.txt)
20-
- We also provide a `llms-full.txt` file on a per-product basis, i.e [`/workers/llms-full.txt`](/workers/llms-full.txt)
21-
- [`/$page/index.md`](index.md)
22-
- Add `/index.md` to the end of any page to get the Markdown version, i.e [`/style-guide/index.md`](/style-guide/index.md)
23-
- [`/markdown.zip`](/markdown.zip)
24-
- An export of all of our documentation in the aforementioned `index.md` format.
25-
26-
In the top right of this page, you will see a `Page options` button where you can copy the current page as Markdown that can be given to your LLM of choice.
27-
28-
<Width size="medium">
29-
![Page options
30-
button](~/assets/images/style-guide/how-we-docs/page-options.png)
31-
</Width>
16+
<Render file="llms-txt" product="style-guide" />
3217

3318
## Textual representation of interactive elements
3419

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
{}
3+
---
4+
5+
import { Width } from "~/components";
6+
7+
We have implemented `llms.txt`, `llms-full.txt` and also created per-page Markdown links as follows:
8+
9+
- [`llms.txt`](/llms.txt)
10+
- [`llms-full.txt`](/llms-full.txt)
11+
- We also provide a `llms-full.txt` file on a per-product basis, i.e [`/workers/llms-full.txt`](/workers/llms-full.txt)
12+
- [`/$page/index.md`](index.md)
13+
- Add `/index.md` to the end of any page to get the Markdown version, i.e [`/style-guide/index.md`](/style-guide/index.md)
14+
- [`/markdown.zip`](/markdown.zip)
15+
- An export of all of our documentation in the aforementioned `index.md` format.
16+
17+
In the top right of this page, you will see a `Page options` button where you can copy the current page as Markdown that can be given to your LLM of choice.
18+
19+
<Width size="medium">
20+
![Page options
21+
button](~/assets/images/style-guide/how-we-docs/page-options.png)
22+
</Width>

0 commit comments

Comments
 (0)