You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: supplementary_style_guide/style_guidelines/formatting.adoc
+46-45Lines changed: 46 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,23 +51,61 @@ default active yes yes
51
51
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[].
52
52
53
53
[[explain-commands-variables-in-code-blocks]]
54
-
== Explain commands and variables in code blocks
54
+
== Explanation of commands and variables used in code blocks
55
55
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 valuesin a code block, do not use callouts.
57
57
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.
59
61
+
60
62
.Example AsciiDoc: A simple sentence explaining a single command
61
-
+
63
+
62
64
[source,terminal]
63
65
----
64
66
$ hcp create cluster <platform> --help
65
67
----
66
68
+
67
69
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
. 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.
70
107
** 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.
71
109
+
72
110
.Example AsciiDoc: A bulleted list explaining the structure of an YAML file
73
111
@@ -113,47 +151,10 @@ spec:
113
151
- build-image
114
152
...
115
153
----
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
<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`.
0 commit comments