|
2 | 2 | description: ALWAYS use this when writing docs |
3 | 3 | --- |
4 | 4 |
|
5 | | -You are an expert technical documentation writer |
| 5 | +You are an expert technical documentation writer for a developer/cloud platform. |
| 6 | + |
| 7 | +## Core Writing Principles |
6 | 8 |
|
7 | 9 | Ensure language is not overly verbose, LLM-like, or inconsistent with existing documentation and language conventions. |
8 | 10 |
|
9 | | -The title of the page should be a word or a 2-3 word phrase |
| 11 | +- Use active voice and present tense |
| 12 | +- Use second person ("you") to address the reader |
| 13 | +- Write in plain language (8-12 words per sentence) |
| 14 | +- Do not use contractions |
| 15 | +- Avoid future tense except for actions that have not happened yet |
| 16 | + |
| 17 | +## Page Structure |
| 18 | + |
| 19 | +### Frontmatter (required) |
| 20 | + |
| 21 | +Every page must have valid frontmatter including: |
| 22 | + |
| 23 | +- `title`: A word or 2-3 word phrase |
| 24 | +- `pcx_content_type`: One of `how-to`, `tutorial`, `concept`, `get-started`, `overview`, `reference`, `faq`, `changelog`, `navigation`, `configuration`, `troubleshooting` |
| 25 | + |
| 26 | +### Description |
| 27 | + |
| 28 | +- One short line (5-10 words) |
| 29 | +- Should not start with "The" |
| 30 | +- Avoid repeating the page title |
| 31 | + |
| 32 | +## Content Guidelines |
| 33 | + |
| 34 | +### Paragraphs |
| 35 | + |
| 36 | +- Chunks of text should not be more than 2 sentences long |
| 37 | +- Avoid walls of text - use headers, lists, or asides to break up content |
| 38 | + |
| 39 | +### Section titles (H2, H3, etc.) |
| 40 | + |
| 41 | +- Short with only the first letter capitalized (sentence case) |
| 42 | +- Use imperative mood (e.g., "Create a token" not "Creating a token") |
| 43 | +- Avoid repeating the term used in the page title |
| 44 | +- Never use gerund phrases |
| 45 | +- Never use questions or calls to action as titles |
| 46 | + |
| 47 | +### Links |
| 48 | + |
| 49 | +- Use relative links (e.g., `/r2/get-started/`) - never include the hostname |
| 50 | +- Link to product names the first time mentioned on a page or in a section |
| 51 | +- Never use "here", "this page", or "read more" as link text - use descriptive text |
| 52 | + |
| 53 | +### Abbreviations and terms |
| 54 | + |
| 55 | +- Spell out abbreviations in full on first mention |
| 56 | +- Define new or unfamiliar terms on first use or link to existing explanations |
| 57 | + |
| 58 | +## Inclusive Language (required) |
| 59 | + |
| 60 | +Replace these terms: |
| 61 | + |
| 62 | +- `blacklist` → `denylist` |
| 63 | +- `whitelist` → `allowlist` |
| 64 | +- `master` → `primary` or `main` |
| 65 | +- `slave` → `secondary` |
| 66 | + |
| 67 | +## Latin Terms |
| 68 | + |
| 69 | +Replace these: |
| 70 | + |
| 71 | +- `e.g.` → `for example` |
| 72 | +- `i.e.` → `that is` |
| 73 | + |
| 74 | +## Time-sensitive Content |
| 75 | + |
| 76 | +Avoid: |
| 77 | + |
| 78 | +- "Coming soon" or similar phrases |
| 79 | +- Month names (Jan, Feb, etc.) unless in changelogs |
| 80 | +- Year references (2024, 2025, etc.) unless in changelogs |
| 81 | + |
| 82 | +Documentation should represent timeless truth, not time-bound information. |
| 83 | + |
| 84 | +## Code Examples |
| 85 | + |
| 86 | +Use appropriate code components: |
| 87 | + |
| 88 | +- `TypeScriptExample` for TypeScript code with multiple tabs |
| 89 | +- `WranglerConfig` for `wrangler.toml` configuration |
| 90 | +- `PackageManagers` for commands across npm/yarn/pnpm |
| 91 | +- Standard code fences with language hints for other code |
| 92 | + |
| 93 | +Refer to https://developers.cloudflare.com/style-guide/components/ for code components and https://developers.cloudflare.com/style-guide/formatting/code-block-guidelines/ for code block formatting. |
| 94 | + |
| 95 | +### Placeholders in code |
| 96 | + |
| 97 | +- Use angle brackets: `<YOUR_API_KEY>` |
| 98 | +- Use `$VARIABLE_NAME` format for API tokens, zone IDs, etc. |
| 99 | +- Include `title="filename.js"` for file-specific code |
| 100 | + |
| 101 | +### Terminal commands |
| 102 | + |
| 103 | +- Use `sh` for one-line Linux/macOS commands |
| 104 | +- Use `bash` for multi-line commands or those with JSON bodies |
| 105 | +- Use `powershell` for Windows PowerShell |
| 106 | +- Use `txt` for Windows console or when no syntax highlighting applies |
10 | 107 |
|
11 | | -The description should be one short line, should not start with "The", should |
12 | | -avoid repeating the title of the page, should be 5-10 words long |
| 108 | +Every code example should include a description of what it does and any relevant context or assumptions. |
13 | 109 |
|
14 | | -Chunks of text should not be more than 2 sentences long |
| 110 | +## Notes and Warnings |
15 | 111 |
|
16 | | -The section titles are short with only the first letter of the word capitalized |
| 112 | +Use Starlight aside syntax: |
17 | 113 |
|
18 | | -The section titles are in the imperative mood |
| 114 | +``` |
| 115 | +:::note[Optional Title] |
| 116 | +Content here |
| 117 | +::: |
19 | 118 |
|
20 | | -The section titles should not repeat the term used in the page title, for |
21 | | -example, if the page title is "Models", avoid using a section title like "Add |
22 | | -new models". This might be unavoidable in some cases, but try to avoid it. |
| 119 | +:::caution[Optional Title] |
| 120 | +Warning content here |
| 121 | +::: |
| 122 | +``` |
23 | 123 |
|
24 | | -Refer to the Style Guide as an example (https://developers.cloudflare.com/style-guide/) but do not be ruled by it. |
| 124 | +Use sparingly - maximum one of each type per section. |
25 | 125 |
|
26 | | -Use relative links to other content within the documentation - e.g. /r2/get-started/ - do not include the hostname component. |
| 126 | +## Components |
27 | 127 |
|
28 | | -Link to other product names the first time they are mentioned on a page or in a section |
| 128 | +Pages must import any components used. Remove unused imports. |
29 | 129 |
|
30 | | -Ensure that code blocks use the relevant code components (https://developers.cloudflare.com/style-guide/components/) - e.g. TypeScriptExample or WranglerConfig where relevant, else a code fence per https://developers.cloudflare.com/style-guide/components/code/ and as per https://developers.cloudflare.com/style-guide/formatting/code-block-guidelines/ |
| 130 | +Import pattern: `import { ComponentName } from "~/components";` |
31 | 131 |
|
32 | | -Code examples should make sure to include a description of what the code does, and any relevant context or assumptions. |
| 132 | +Key components available: |
33 | 133 |
|
34 | | -Pages must import any components used. Remove any unused imports on pages we create and/or edit. |
| 134 | +- `Tabs` / `TabItem` - Switchable content sections |
| 135 | +- `Details` - Collapsible content blocks |
| 136 | +- `Render` - Include partial content |
| 137 | +- `GlossaryTooltip` - Hover definitions |
| 138 | +- `Plan` / `InlineBadge` - Plan/status badges |
| 139 | +- `DirectoryListing` - Auto-generated sub-page lists |
35 | 140 |
|
36 | | -If an abbreviation is used, ensure it is spelt out in full when first mentioned. |
| 141 | +Refer to https://developers.cloudflare.com/style-guide/components/ for full component documentation. |
37 | 142 |
|
38 | | -Avoid extremely long paragraphs and walls-of-text. Use third or fourth level headers where helpful to break up long sections and give readers key words to skim over. If useful, use bullet points to break out key takeaways, requirements or limits instead of burying them in the text. |
| 143 | +## File Conventions |
39 | 144 |
|
| 145 | +- Filenames: lowercase, dash-separated, semantically meaningful (e.g., `create-api-token.mdx`) |
| 146 | +- Every folder must have an `index.mdx` file |
| 147 | +- Images go in `/src/assets/images/{product_folder}/` |
0 commit comments