The <screen>
command is used to format text
within a document and is great for adding emphasis to show examples of
code, computer output, and more. In HTML with the Fedora CSS file, this
appears in box with a grey background. To use this command you only need
the opening <screen>
and closing
</screen>
tags around the text you are
emphasizing.
Important | |
---|---|
When using the |
The <screen>
tag set may contain other inline
tags, such as <computeroutput>
,
<userinput>
, or
<replaceable>
. Additional inline tags are not
required by definition. The <screen>
tags by
themselves may provide sufficient context, especially for simple examples
or file listings. Consider the context of the example, and use inline tags
if they are helpful to the reader.
If you use inline tags, remember that line breaks inside
<screen>
tags create line breaks in any rendered
output. Place any inline tags on the same line as
their content. Do not overuse tagging within a
<screen>
tag set.
An example of <screen>
is the following:
<screen>
This is an example of a screen. You do not need <para> tags
within this command.
</screen>
The output:
This is an example of a screen. You do not need <para> tags within this command.
If you choose to use inline tags inside a
<screen>
section, follow these guidelines for
consistency. If the content in the screen is a listing of a
configuration file or the output of a program, use the
<computeroutput>
tag set around the entire
output. If the user should type the example on the command line or in
a configuration file, use the <userinput>
tag
set. Separate input and output with a short sentence of narrative, as
below:
<para>
Type the following command:</para>
<screen>
<userinput>
command -sw file1</userinput>
</screen>
<para>
You should see the following output:</para>
<screen>
<computeroutput>
Completed, time = 0.12 sec</computeroutput>
</screen>
The output looks like:
Type the following command:
command -sw file1
You should see the following output:
Completed, time = 0.12 sec
Note | |
---|---|
When showing a command or series of commands inside
|
If the <screen>
shows the reader how to
change only part of a line, mark the change with
an inline <userinput>
tag set. You may use
the <userinput>
tag set inside a larger area
that is already marked inline with
<computeroutput>
. Do not include any extra
lines of context in this case, unless excluding them would confuse the
reader. The following example illustrates these guidelines:
<para>
Edit the<filename>
/etc/sysconfig/init</filename>
file as follows:</para>
<screen>
GRAPHICAL=<userinput>
yes</userinput>
</screen>
The output looks like:
Edit the /etc/sysconfig/init
file as follows:
GRAPHICAL=yes
For an explanation of how to use the replaceable
tags within a set of screen
tags, refer to Section 6.21, “replaceable
”.