Skip to content

Commit 66a24b1

Browse files
authored
Merge pull request #59535 from apinnick/ocg-yaml-ellipsis-guidelines
Update OCG YAML ellipsis guidelines and examples
2 parents 5ef913a + bb78db1 commit 66a24b1

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

contributing_to_docs/doc_guidelines.adoc

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,15 +1209,15 @@ $ oc get endpoints --all-namespaces --template \
12091209
# subscription-manager list
12101210
----
12111211

1212-
* For snippets or sections of a file, use an ellipsis (`...`) to show that the file continues before and/or after the quoted block.
1212+
* For snippets or sections of a file, use an ellipsis (`...` or `# ...` for YAML) to show that the file continues before or after the quoted block.
12131213
+
12141214
----
12151215
apiVersion: v1
12161216
kind: Pod
12171217
metadata:
12181218
labels:
12191219
test: liveness
1220-
...
1220+
# ...
12211221
----
12221222
+
12231223
or
@@ -1298,10 +1298,10 @@ apiVersion: config.openshift.io/v1
12981298
kind: Scheduler
12991299
metadata:
13001300
name: cluster
1301-
...
1301+
# ...
13021302
spec:
13031303
defaultNodeSelector: node-role.kubernetes.io/app=
1304-
...
1304+
# ...
13051305
----
13061306

13071307
.Example deeply nested key with full context for `.ports` array
@@ -1322,7 +1322,7 @@ spec:
13221322
----
13231323

13241324
==== Formatting
1325-
Use the following conventions govern the layout of YAML for API objects.
1325+
The following conventions govern the layout of YAML for API objects:
13261326

13271327
- Begin YAML at the beginning of the left margin.
13281328
- Use two-space indentation.
@@ -1335,7 +1335,8 @@ fieldName: |-
13351335
This is a string.
13361336
And it can be on multiple lines.
13371337
----
1338-
- When truncating YAML, always precede an ellipsis with a pound so that the YAML is valid.
1338+
- When truncating YAML, comment out the ellipsis (`# ...`) because three dots (`...`) in YAML is actually a link:https://yaml.org/spec/1.2.2/#22-structures[document end marker].
1339+
- Use three hyphens (`---`) to separate YAML definitions in a single YAML file.
13391340

13401341
.Example with array indentation flush with parent field
13411342
----
@@ -1347,7 +1348,7 @@ metadata:
13471348
- key1: val1
13481349
- key2: val2
13491350
spec:
1350-
...
1351+
# ...
13511352
----
13521353

13531354
.Example with block string for annotation
@@ -1364,7 +1365,7 @@ metadata:
13641365
}
13651366
]
13661367
spec:
1367-
...
1368+
# ...
13681369
----
13691370

13701371
=== Inline code or commands

0 commit comments

Comments
 (0)