Skip to content

Commit a225f27

Browse files
authored
Merge pull request #413 from jherrman/Issue#390_bold-commands-in-codeblocks
Issue#390 - bold commands in codeblocks
2 parents 8e2465b + a05bcc0 commit a225f27

File tree

1 file changed

+49
-7
lines changed

1 file changed

+49
-7
lines changed

supplementary_style_guide/style_guidelines/formatting.adoc

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,47 @@
11
[[formatting]]
22
= Formatting
33

4+
[[commands-in-code-blocks]]
5+
== Commands in code blocks
6+
7+
Use a single command per code block for each procedure step. This approach helps with readability and makes it possible for the copy button in code blocks to work correctly.
8+
9+
By default, use bold formatting for commands in code blocks to visually distinguish the commands from their lead-in sentences and from the command prompts and example outputs. For consistency, use bold formatting for commands even when no command output is shown in the code block.
10+
11+
[NOTE]
12+
====
13+
To apply formatting in a code block, you must use the `quotes` link:https://docs.asciidoctor.org/asciidoc/latest/subs/apply-subs-to-blocks/[AsciiDoc substitution].
14+
====
15+
16+
.Example AsciiDoc: A command and its output in a code block
17+
18+
Verify that the `libvirt` default network is active and configured to start automatically:
19+
20+
[subs="+quotes"]
21+
----
22+
# *virsh net-list --all*
23+
Name State Autostart Persistent
24+
--------------------------------------------
25+
default active yes yes
26+
----
27+
28+
29+
This example renders as follows in HTML:
30+
31+
====
32+
Verify that the `libvirt` default network is active and configured to start automatically:
33+
34+
[subs="+quotes"]
35+
----
36+
# *virsh net-list --all*
37+
Name State Autostart Persistent
38+
--------------------------------------------
39+
default active yes yes
40+
----
41+
====
42+
43+
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[].
44+
445
[[date-formats]]
546
== Date formats
647

@@ -121,6 +162,7 @@ Write all titles and headings, including the titles of product documentation gui
121162
* _Configuring the node port service range_
122163
* _How to perform an unsupported conversion from a RHEL-derived Linux distribution to RHEL_
123164

165+
124166
[[user-replaced-values]]
125167
== User-replaced values
126168

@@ -148,7 +190,7 @@ Ensure that user-replaced values have the following characteristics:
148190
Create an Ansible inventory file that is named `/_<path>_/inventory/hosts`.
149191
----
150192

151-
This renders as:
193+
This example renders as follows in HTML:
152194

153195
====
154196
Create an Ansible inventory file that is named `/_<path>_/inventory/hosts`.
@@ -160,15 +202,15 @@ To italicize a user-replaced value in a code block, you must add an attribute to
160202

161203
[subs="+quotes"]
162204
----
163-
$ oc describe node __<node_name>__
205+
$ *oc describe node __<node_name>__*
164206
----
165207

166-
This renders as:
208+
This example renders as follows in HTML:
167209

168210
====
169211
[subs="+quotes"]
170212
----
171-
$ oc describe node __<node_name>__
213+
$ *oc describe node __<node_name>__*
172214
----
173215
====
174216

@@ -182,7 +224,7 @@ $ oc describe node __<node_name>__
182224
connection.interface-name: enp7s0
183225
----
184226

185-
This renders as:
227+
This example renders as follows in HTML:
186228

187229
====
188230
[subs="+quotes"]
@@ -214,7 +256,7 @@ Ensure that user-replaced values in XML have the following characteristics:
214256
<ipAddress>__${ip_address}__</ipAddress>
215257
----
216258

217-
This renders as:
259+
This example renders as follows in HTML:
218260

219261
====
220262
[source,xml,subs="+quotes"]
@@ -230,7 +272,7 @@ This renders as:
230272
<oauth2-introspection client-id="__${client_id}__"/>
231273
----
232274

233-
This renders as:
275+
This example renders as follows in HTML:
234276

235277
====
236278
[source,xml,subs="+quotes"]

0 commit comments

Comments
 (0)