Skip to content

Commit f7c07dc

Browse files
authored
Merge pull request #547 from Preeticp/callouts1
Modified title, hyphens, guidance, unordered list
2 parents 7e4d390 + 7dfa540 commit f7c07dc

File tree

1 file changed

+46
-45
lines changed

1 file changed

+46
-45
lines changed

supplementary_style_guide/style_guidelines/formatting.adoc

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,61 @@ default active yes yes
5151
For commands and command outputs in code blocks, observe the correct markup for user-replaced values, as described in xref:user-replaced-values[] and xref:user-replaced-values-xml[].
5252

5353
[[explain-commands-variables-in-code-blocks]]
54-
== Explain commands and variables in code blocks
54+
== Explanation of commands and variables used in code blocks
5555

56-
To explain commands, lines of code, or variables (user-replaced values) used in a code block, follow the code block with the relevant explanation or description of the elements.
56+
To explain commands, lines of code, or user-replaced values in a code block, do not use callouts.
5757

58-
. Use a simple sentence to explain or describe a single line of command, variable, option, or parameter.
58+
Instead, follow the code block with the relevant explanation or description of the elements, using the following guidelines:
59+
60+
* Use a simple sentence to explain or describe a single line of command, variable, option, or parameter.
5961
+
6062
.Example AsciiDoc: A simple sentence explaining a single command
61-
+
63+
6264
[source,terminal]
6365
----
6466
$ hcp create cluster <platform> --help
6567
----
6668
+
6769
Use the `hcp create cluster` command to create and manage hosted clusters. The supported platforms are `aws`, `agent`, and `kubevirt`.
70+
71+
* Use a definition list to explain multiple options, parameters, user-replaced values, placeholders, or UI elements.
72+
** List the parameters or variables in the order in which they appear in the code block.
73+
** Introduce definition lists with "where:" and begin each variable description with "Specifies".
74+
+
75+
.Example AsciiDoc: A definition list explaining user-replaced values
76+
77+
[source,yaml,subs="+attributes,+quotes"]
78+
----
79+
$ cat <<EOF | oc -n <my_product_namespace> create -f -
80+
apiVersion: v1
81+
kind: Secret
82+
metadata:
83+
name: <my_product_database_certificates_secrets>
84+
type: Opaque
85+
stringData:
86+
postgres-ca.pem: |-
87+
-----BEGIN CERTIFICATE-----
88+
<ca_certificate_key>
89+
postgres-key.key: |-
90+
-----BEGIN CERTIFICATE-----
91+
<tls_private_key>
92+
postgres-crt.pem: |-
93+
-----BEGIN CERTIFICATE-----
94+
<tls_certificate_key>
95+
# ...
96+
EOF
97+
----
6898
+
69-
. Use a bulleted list to describe the structure of a sample YAML file or explain multiple lines of code in a code block.
99+
where:
100+
101+
`<my_product_database_certificates_secrets>`:: Specifies the name of the certificate secret.
102+
`<ca_certificate_key>`:: Specifies the CA certificate key.
103+
`<tls_private_key>`:: Specifies the TLS private key.
104+
`<tls_certificate_key>`:: Specifies the TLS certificate key.
105+
106+
* Use a bulleted list to describe the structure of a sample YAML file or explain multiple lines of code in a code block.
70107
** List the explanations in the order in which they appear in the code block.
108+
** Use the bullet format that makes the most sense for your explanations. You do not have to follow the exact wording in the following example.
71109
+
72110
.Example AsciiDoc: A bulleted list explaining the structure of an YAML file
73111

@@ -113,47 +151,10 @@ spec:
113151
- build-image
114152
...
115153
----
116-
117-
* `workspaces`: List of pipeline workspaces shared between the tasks defined in the pipeline. A pipeline can define as many workspaces as required. In this example, only one workspace named `shared-workspace` is declared.
118-
* `tasks`: Definition of tasks used in the pipeline. This snippet defines two tasks, `build-image` and `apply-manifests`.
119-
* `tasks.name.workspaces`: List of task workspaces used in the `build-image` and `apply-manifests` tasks. A task definition can include as many workspaces as it requires. However, it is recommended that a task uses at most one writable workspace. In this example, both the tasks share a common task workspace named `source`, which in turn shares the pipeline workspace named `shared-workspace`.
120-
121-
. Use a definition list to explain multiple options, parameters, variables, placeholders, or UI elements.
122-
** List the parameters/variables in the order in which they appear in the code block.
123-
** Introduce definition lists with "where:" and begin each variable description with "Specifies".
124-
+
125-
.Example AsciiDoc: A definition list explaining user-replaced values
126-
127-
[source,yaml,subs="+attributes,+quotes"]
128-
----
129-
cat <<EOF | oc -n {my-product-namespace} create -f -
130-
apiVersion: v1
131-
kind: Secret
132-
metadata:
133-
name: <my-product-database-certificates-secrets>
134-
type: Opaque
135-
stringData:
136-
postgres-ca.pem: |-
137-
-----BEGIN CERTIFICATE-----
138-
<ca-certificate-key>
139-
postgres-key.key: |-
140-
-----BEGIN CERTIFICATE-----
141-
<tls-private-key>
142-
postgres-crt.pem: |-
143-
-----BEGIN CERTIFICATE-----
144-
<tls-certificate-key>
145-
# ...
146-
EOF
147-
----
148154
+
149-
where:
150-
151-
<my-product-database-certificates-secrets>:: Specifies the name of the certificate secret.
152-
<ca-certificate-key>:: Specifies the CA certificate key.
153-
<tls-private-key> Optional:: Specifies the TLS private key.
154-
<tls-certificate-key> Optional:: Specifies the TLS certificate key.
155-
156-
. Use the appropriate admonition style to add notes pertaining to a code block, as described in xref:admonitions[].
155+
*** `spec.workspaces` defines the list of pipeline workspaces shared between the tasks defined in the pipeline. A pipeline can define as many workspaces as required. In this example, only one workspace named `shared-workspace` is declared.
156+
*** `spec.tasks` defines the tasks used in the pipeline. This snippet defines two tasks, `build-image` and `apply-manifests`.
157+
*** `spec.tasks.workspaces` defines the list of task workspaces used in the `build-image` and `apply-manifests` tasks. A task definition can include as many workspaces as it requires. However, it is recommended that a task uses at most one writable workspace. In this example, both the tasks share a common task workspace named `source`, which in turn could share the pipeline workspace named `shared-workspace`.
157158

158159
[[date-formats]]
159160
== Date formats

0 commit comments

Comments
 (0)