Skip to content

Commit c9c46db

Browse files
authored
placeholder variables (#21377)
1 parent 2868b2d commit c9c46db

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

src/content/docs/style-guide/api-content-strategy/guidelines-for-curl-commands.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To automatically incorporate our conventions into your examples, use:
1515
- [`APIRequest`](/style-guide/components/api-request/): For examples hitting endpoints in the Cloudflare API schema.
1616
- [`CURL`](/style-guide/components/curl/): For other cURL commands.
1717

18-
## Paramter names
18+
## Parameter names
1919

2020
Use long parameter names for clarity:
2121

@@ -45,7 +45,7 @@ If you must suggest the use of this tool, you can add a link to the [Make API ca
4545

4646
* Make sure not to use typographical or smart quotes in a cURL command, or the command will fail.
4747
* Placeholders in the URL should follow the same format as in the API documentation: `$ZONE_ID`
48-
* Placeholders in the request body (that is, the data included in a `POST`/`PUT`/`PATCH` request) should use this format: `<RULE_ID>`
48+
* Placeholders in the request body (that is, the data included in a `POST`/`PUT`/`PATCH` request) should use [angle brackets](/style-guide/formatting/code-conventions-and-format/#angle-brackets---and--): `<RULE_ID>`
4949

5050
The same placeholder name should correspond to the same value – use different placeholder names for different ID values. You can use the same request placeholders in the response, if they should match the values in the request.
5151

src/content/docs/style-guide/formatting/code-conventions-and-format.mdx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@ Use the conventions described below throughout Cloudflare product content.
88

99
## Angle brackets ( `<` and `>` )
1010

11-
Use angle brackets as a placeholder for variables you want the user to enter (except in URLs, where you should use curly braces for placeholders).
11+
Use angle brackets to denote placeholders for variables you want the user to enter (except in [API URLs and API authentication headers](/style-guide/api-content-strategy/guidelines-for-curl-commands/#request-guidelines), where you should use the `$ZONE_ID` / `$CLOUDFLARE_API_TOKEN` format). Placeholder text should have all capital letters and use underscores (`_`) to separate words.
1212

13-
Example:
14-
15-
Type your user-specified domain in this format: `https://<user-specified domain>.cloudflare.com`
13+
Examples:
1614

1715
```
1816
{
1917
"description": "<RULE_DESCRIPTION>"
2018
}
2119
```
2220

21+
```
22+
https://<YOUR_DOMAIN>.cloudflare.com
23+
```
24+
2325
Angle brackets that contain numbers separated by an ellipsis represent a range of values associated with a bit or single name - for example, AO `<0...3>`.
2426

2527
## Square brackets ( `[` and `]` )
@@ -32,13 +34,7 @@ Specify a subsearch that starts with this search command: `tag=dns query [search
3234

3335
## Curly braces ( `{` and `}` )
3436

35-
Use curly braces in the following situations, such as:
36-
37-
When they are part of a code sample or other string literal, such as in placeholders inside a URL.
38-
39-
Example:
40-
41-
`https://api.cloudflare.com/client/v4/organizations/{organization_identifier}/invites`
37+
Do not use curly braces for URL or variable placeholders. Instead, refer to [angle brackets](#angle-brackets---and--).
4238

4339
## >
4440

0 commit comments

Comments
 (0)