Skip to content

Commit

Permalink
Merge pull request #519 from apinnick/ellipses-yaml-code-blocks
Browse files Browse the repository at this point in the history
Ellipses yaml code blocks
  • Loading branch information
bredamc authored Oct 9, 2024
2 parents 644dc6b + baef5c3 commit ae59c8d
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions supplementary_style_guide/style_guidelines/code-commands.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Do not rely solely on a shell prompt in a sample command to indicate the require
If you include a shell prompt to indicate that a user with root privileges must run the command, also include a statement about this requirement in the step text, the introductory text, or the prerequisites.
====
+
* When a sample command includes `sudo`, use the `$` prompt, not `#`, as shown in the following example:
* When a sample command includes `sudo`, use the `$` prompt, not `#`, as shown in the following example:
+
[source,terminal]
----
$ sudo systemctl start firewalld
----
+
* If multiple commands in a procedure require root privileges, add introductory content to tell the user about the requirement.
* If multiple commands in a procedure require root privileges, add introductory content to tell the user about the requirement.
The following example shows one way that you could integrate a requirement for root access into the introduction for a procedure:
+
.Example AsciiDoc
Expand All @@ -39,6 +39,26 @@ Some tasks in this procedure require root privileges, which you can get temporar
.Additional resources
* link:https://www.redhat.com/sysadmin/difference-between-sudo-su[Exploring the differences between sudo and su commands in Linux]

[[ellipses-in-yaml-code-blocks]]
== Ellipses in YAML code blocks

Use the number sign (`#`) to comment out an ellipsis in YAML code blocks.
YAML reserves `...` to indicate the end of a document without starting a new document.

.Example AsciiDoc

[source,yaml]
----
apiVersion: operator.openshift.io/v1alpha1
kind: CertManager
metadata:
name: cluster
# ...
----

.Additional resources
* link:https://yaml.org/spec/1.2.2/#22-structures[YAML 1.2: Structures]

[[ip-addresses-and-mac-addresses]]
== IP addresses and MAC addresses

Expand Down

0 comments on commit ae59c8d

Please sign in to comment.