Jump to: navigation, search

Difference between revisions of "Documentation/Conventions"

(DocBook markup conventions)
(DocBook markup conventions)
Line 45: Line 45:
 
Since Nova exposes both its own API and an EC2-compatible API, many tasks can be executed using either the nova CLI or euca2ools. Documentation related to euca2ools should generally be limited to:
 
Since Nova exposes both its own API and an EC2-compatible API, many tasks can be executed using either the nova CLI or euca2ools. Documentation related to euca2ools should generally be limited to:
  
    * Describing euca2ools commands that don't yet have a nova CLI equivalent (e.g., euca-get-console-output)
+
* Describing euca2ools commands that don't yet have a nova CLI equivalent (e.g., euca-get-console-output)
    * Describing how to get credentials to work with euca2ools
+
* Describing how to get credentials to work with euca2ools
    * Describing differences between how Amazon's EC2 endpoint behaves and how an OpenStack endpoint behaves when accessing via EC2.
+
* Describing differences between how Amazon's EC2 endpoint behaves and how an OpenStack endpoint behaves when accessing via EC2.
  
 
=== Adding a line break ===
 
=== Adding a line break ===
In verbatim elements, you explicitly control line breaks. In the output of non-verbatim block elements (such as paragraphs and table cells), lines normally break automatically, for example at a fixed page or table boundary or when the reader resizes an HTML page. Automatic line breaking can fail if the text contains long strings that contain no whitespace. When that happens, the text is clipped or overflows the page or table boundaries.  
+
The output of verbatim elements like <code>screen</code> and <code>programlisting</code> preserves the whitespace that you enter in the source, including line breaks.
  
If a line fails to break normally, try adding whitespace (like spaces) in the source where you want to allow line breaks. If that method is not available, you can force a line break anywhere in text by inserting the <code><?sbr?></code> processing instruction.  
+
In the output of non-verbatim elements (such as paragraphs and table cells), lines normally break automatically, for example at a fixed page or table boundary or when the reader resizes an HTML page. Automatic line breaking can fail if the text contains long strings that contain no whitespace. When that happens, the text is clipped or overflows the page or table boundaries.
 +
 
 +
If a line fails to break normally in output, try adding whitespace (like spaces) in the source where you want to allow line breaks. If that method is not available, you can force a line break anywhere in text by inserting the <code><?sbr?></code> processing instruction.  
  
 
'''Example'''
 
'''Example'''
Line 71: Line 73:
  
 
Program source or source fragments formatted as a standalone block. (For inline source fragments see [[Code or data (inline)]].  
 
Program source or source fragments formatted as a standalone block. (For inline source fragments see [[Code or data (inline)]].  
Content is displayed verbatim, so whitespace is significant, including spaces, tabs, and line breaks. Text is usually displayed in a fixed-width font.
+
Whitespace in the source, including spaces, tabs, and line breaks, is preserved in the output. Text is usually displayed in a fixed-width font.
  
 
'''Example'''
 
'''Example'''
Line 97: Line 99:
 
'''Use tag''': <code>literal</code>
 
'''Use tag''': <code>literal</code>
  
A fragment of code within a line of text. If you are instructing users to enter the code or data, consider <code>userinput</code> instead of <code>literal</code>.
+
A fragment of code within a line of text. If you are telling or expecting users to enter the code or data, use <code>userinput</code> instead.
  
 
'''Examples'''
 
'''Examples'''
Line 119: Line 121:
  
 
See [[Computer output]] for a multiline example.
 
See [[Computer output]] for a multiline example.
 +
 
=== Computer output ===
 
=== Computer output ===
 
'''Use tag''': <code>computeroutput</code>
 
'''Use tag''': <code>computeroutput</code>
Line 126: Line 129:
 
'''Example'''
 
'''Example'''
  
This example of an interactive session in a terminal combines a prompt, user input, and the resulting computer output in a <code>screen</code>:
+
This interactive terminal session combines a prompt, user input, and the resulting computer output in a <code>screen</code>:
  
 
<pre><nowiki><para>Mount the image in read-write mode by entering, as root:</para>
 
<pre><nowiki><para>Mount the image in read-write mode by entering, as root:</para>
Line 148: Line 151:
 
'''Example'''
 
'''Example'''
  
<pre><nowiki>Use the <command>nova network-create</command> command to create the subnet that the VMs reside on.</nowiki></pre>
+
<pre><nowiki><para>Use the <command>nova network-create</command> command to create the subnet that the VMs reside on.</para></nowiki></pre>
  
 
=== Command line prompt ===
 
=== Command line prompt ===
Line 155: Line 158:
 
'''Example'''
 
'''Example'''
 
   
 
   
<pre><nowiki><screen><prompt>$</prompt> <userinput>sudo addgroup nova</userinput></screen></nowiki></pre>
+
<pre><nowiki><screen><prompt>$ </prompt><userinput>sudo addgroup nova</userinput></screen></nowiki></pre>
  
 
=== File name or path ===
 
=== File name or path ===
Line 180: Line 183:
 
'''Use tag''': <code>systemitem</code>
 
'''Use tag''': <code>systemitem</code>
  
Refer to components in an operating system or API by name, including system services, daemons, methods, classes, and functions. To  refer to the item's location rather than its name, consider using <code>filename</code> instead.
+
Operating system or API components that you refer to by name, including system services, daemons, methods, classes, and functions. To  refer to an item's location rather than its name, use <code>filename</code> instead.
  
 
Example
 
Example
Line 191: Line 194:
 
'''Use tag''': <code>xref</code>
 
'''Use tag''': <code>xref</code>
  
Cross-references a target element in the same document. The "hot" link text that appears in the output is normally generated automatically from the target object during processing. For this reason, <code>xref</code> usually point to targets that have a title or a similar associated label.  
+
Cross-reference an element, in the same document, that can automatically provide the link text. The "hot" link text that appears in the output is generated automatically from the target object during processing. For this reason, <code>xref</code> usually point to targets that have a title or a associated label (such as a numbered step in a procedure).  
  
 
Compare this to a cross reference using <code>link</code>, where you specify the link text yourself. The advantage of using <code>xref</code> is that the link text is not static: if the title of the target changes, your link text is automatically updated in the next build.  
 
Compare this to a cross reference using <code>link</code>, where you specify the link text yourself. The advantage of using <code>xref</code> is that the link text is not static: if the title of the target changes, your link text is automatically updated in the next build.  
Line 221: Line 224:
 
'''Use tag''': <code>link</code>
 
'''Use tag''': <code>link</code>
  
You can use <code>link</code> to cross-reference another element in the same document, or link to an external resource like an HTML page or PDF document.   
+
Cross-reference another element (which may or may not have a title) in the same document, or link to an external resource like an HTML page or PDF document.  In the content of the <code>link</code> specify the "hot" text that you want to appear in the output.
  
* To cross-reference an internal target, use the <code>linkend</code> attribute that specifies the target element's <code>xml:id</code>.  
+
* To cross-reference an internal target, in the <code>linkend</code> attribute specify the target element's <code>xml:id</code>.
  
* To cross-reference an external target, use the <code>xlink:href</code> attribute with a URI value.  
+
* To cross-reference an external target, in the <code>xlink:href</code> attribute specify a URI that points to the target.  
  
In the content of the <code>link</code> specify the link text that you want to appear in the output.
+
'''Examples'''
  
'''Example''' (external):
+
This cross-reference points to an external resource and displays the link text, '''Nova'''
  
 
<pre><nowiki><link xlink:href="http://nova.openstack.org">Nova</link></nowiki></pre>
 
<pre><nowiki><link xlink:href="http://nova.openstack.org">Nova</link></nowiki></pre>
  
'''Example''' (internal link)
+
This cross-reference points to an informal table in the same document, and specifies the link text, '''OpenStack Services''':
  
<pre><nowiki><para>The Image Service is central to the overall IaaS picture, as shown in <link linkend="concept_arch">OpenStack Services</link>.</para>
+
<pre><nowiki><para>The Image Service is central to the overall IaaS picture, as shown in <link linkend="concept_arch2">OpenStack Services</link>.</para>
 
...
 
...
<informalfigure xml:id="concept_arch">  
+
<informalfigure xml:id="concept_arch2">  
 
   <mediaobject>
 
   <mediaobject>
 
     <imageobject>
 
     <imageobject>
Line 247: Line 250:
 
</informalfigure></nowiki></pre>
 
</informalfigure></nowiki></pre>
  
As a rule of thumb, use <code>link</code> instead of <code>xref</code> to cross-reference external targets, and internal targets for which DocBook processing does not automatically generate link text  (for example, informal tables or figures, which have no titles). Conversely, if you're cross-referencing an internal target that has a title, consider using <code>xref</code> instead of hard-coding the link text<code>link</code>.
+
As a rule of thumb, use <code>link</code> instead of <code>xref</code> to cross-reference internal targets for which DocBook processing does not automatically generate link text  (for example elements without titles). Conversely, if you're cross-referencing an internal target that has a title or label, consider using <code>xref</code> instead of hard-coding the link text<code>link</code>.
  
 
=== Unlinked URI ===
 
=== Unlinked URI ===
Line 261: Line 264:
 
Tag to use: <code>procedure</code>
 
Tag to use: <code>procedure</code>
  
A formal (titled) sequence of steps. Normally, the steps are rendered as a numbered list in the output. Begin the title with the word, "To", and do not end the title with a colon.  
+
A formal (titled) sequence of steps. Normally, the steps are rendered as a numbered list in the output.  
  
Individual steps don't require titles, and step titles do not have to start with "To."  
+
Begin the title with the word, "To", and do not end the title with a colon. Individual steps don't require titles, and step titles do not have to start with "To."  
  
 
To reduce the number of steps and make long procedures easier to follow, consider breaking steps up into logical groups of substeps.  
 
To reduce the number of steps and make long procedures easier to follow, consider breaking steps up into logical groups of substeps.  
Line 297: Line 300:
  
 
=== Lists ===
 
=== Lists ===
Choose the appropriate list type to presenting a sequence of items. '''Note''': to present steps in a task, use <code>procedure</code> instead.
+
Choose the appropriate list type to presenting a sequence of items. '''Note''': to present steps in a formal task, use <code>procedure</code> instead.
  
 
==== Ordered list ====
 
==== Ordered list ====
Line 315: Line 318:
 
</orderedlist></nowiki></pre>
 
</orderedlist></nowiki></pre>
  
==== Unordered items ====
+
==== Unordered list ====
 
'''Use tag''': <code>itemizedlist</code>
 
'''Use tag''': <code>itemizedlist</code>
  
 
A sequence of items that can happen in any order or whose order doesn't matter.
 
A sequence of items that can happen in any order or whose order doesn't matter.
  
<para>OpenStack with XenAPI supports the following virtual machine image formats:</para>
+
'''Example'''
 +
 
 +
<pre><nowiki><para>OpenStack with XenAPI supports the following virtual machine image formats:</para>
 
<itemizedlist>
 
<itemizedlist>
 
   <listitem><para>Raw</para></listitem>
 
   <listitem><para>Raw</para></listitem>
 
   <listitem><para>VHD (in a gzipped tarball)</para></listitem>
 
   <listitem><para>VHD (in a gzipped tarball)</para></listitem>
</itemizedlist>
+
</itemizedlist></nowiki></pre>
  
 
==== Term/description or key/value pairs ====
 
==== Term/description or key/value pairs ====
 
'''Use tag''': <code>variablelist</code>
 
'''Use tag''': <code>variablelist</code>
  
An unordered list in which each item has a short term (such as a key or option) or phrase in one block, followed by a description block. <code>variablelist</code> is typically rendered as a <code>dl</code> definition list in HTML output, with the term highlighted.
+
An unordered list in which each item has a short term (such as a key or option) or phrase, followed by a block that describes it. <code>variablelist</code> is typically rendered as a <code>dl</code> definition list in HTML output, with the term highlighted.
  
 
Consider using a variable list:
 
Consider using a variable list:
Line 335: Line 340:
  
 
* Instead of a two column table where the first column lists items of a consistent type, such as keys, options, or short terms, and the second column describes the items. Consider that lists are generally more accessible than tables for screen reader users.
 
* Instead of a two column table where the first column lists items of a consistent type, such as keys, options, or short terms, and the second column describes the items. Consider that lists are generally more accessible than tables for screen reader users.
 +
 +
'''Example'''
 +
 +
<pre><nowiki><para>The system has these components:</para>
 +
<variablelist>
 +
  <varlistentry><term>Component A</term>
 +
    <listitem><para>Description of A.</para></listitem>
 +
  </varlistentry>
 +
  <varlistentry><term>Component B</term>
 +
    <listitem><para>Description of B.</para></listitem>
 +
  </varlistentry>
 +
  <varlistentry><term>Component C</term>
 +
    <listitem><para>Description of C.</para></listitem>
 +
  </varlistentry>
 +
</variablelist></nowiki></pre>
  
 
==== A simple, undecorated  list of items ====
 
==== A simple, undecorated  list of items ====
Line 342: Line 362:
 
Present a sequence of words or short phrases without the decorations of a numbered or bulleted list. <code>simplelist</code> offers a variety of flavors.
 
Present a sequence of words or short phrases without the decorations of a numbered or bulleted list. <code>simplelist</code> offers a variety of flavors.
  
'''Example''' (vertical list of undecorated items)
+
'''Example''' (default vertical list)
 
 
By default, simplelist is rendered as standalone block:
 
  
 
<pre><nowiki><para>Valid formats include:</para>
 
<pre><nowiki><para>Valid formats include:</para>
Line 355: Line 373:
 
   </simplelist></nowiki></pre>
 
   </simplelist></nowiki></pre>
  
'''Example''' (inline)  
+
By default, this example is rendered as a standalone block of undecorated items, like this:
 +
 
 +
Valid formats include:
 +
PNG
 +
JPG
 +
GIF
 +
SVG
 +
'''Example''' (inline list)  
  
Here is the same list rendered inline (specified in the type attribute), as a comma-separated list in a paragraph:
+
You can also render a comma-separated list in a paragraph, by adding the <code>type="iinline"</code> attribute:
  
 
<pre><nowiki><para>Valid formats include  
 
<pre><nowiki><para>Valid formats include  
Line 367: Line 392:
 
   </simplelist>
 
   </simplelist>
 
</para></nowiki></pre>
 
</para></nowiki></pre>
 +
 +
The output looks like this:
 +
 +
Valid formats include PNG, JPG, GIF, SVG.
  
 
=== Notes ===
 
=== Notes ===
Line 372: Line 401:
 
'''Use tag''': <code>note</code>, <code>caution</code>, <code>important</code>, <code>tip</code>, or <code>warning</code>
 
'''Use tag''': <code>note</code>, <code>caution</code>, <code>important</code>, <code>tip</code>, or <code>warning</code>
  
A brief message that is set off from the main text. Use <code>note</code> for generic messages; the others have more specific semantic meanings, as their names indicate. By default, these elements automatically generate a title ('''Note''', '''Caution''', and so on.) You can override the default title by explicitly adding a <code>title</code> element with your custom text.
+
A brief message that is set off from the main text. Use <code>note</code> for generic messages; the others have more specific semantic meanings, as their names indicate. By default, these elements automatically generate a title ('''Note''', '''Caution''', and so on.) You can customize the title by explicitly adding a <code>title</code> element.
  
 
'''Example'''
 
'''Example'''
  
Without a <code>title</code> element the output of this example would have the default title, '''Note''':  
+
The title element in this example overrides the default title, '''Note''':  
  
 
<pre><nowiki><note><title>Upcoming Changes</title>
 
<pre><nowiki><note><title>Upcoming Changes</title>
Line 384: Line 413:
 
=== Image ===
 
=== Image ===
  
'''Use tag''': <code>mediaobject</code>, <code>inlinemediaobject</code>
+
'''Use tag''': <code>mediaobject</code>
 +
 
 +
Use <code>mediaobject</code> for a block image. For a formal (titled) image, embed a <code>mediaobject</code> in a <code>figure</code>.
 +
 
 +
'''Note''': <code>inlinemediaobject</code> inserts an image in a text block, such as a paragraph. For our docs, <code>mediaobject</code> is usually the better choice: <code>inlinemediaobject</code> is typically used for small inline graphics (like icons) or to achieve floating effects, and requires some care to use correctly.
  
Use <code>mediaobject</code> for a block image, <code>inlinemediaobject</code> to insert an image (usually a small one like an icon) in a para. For a formal (titled) image, embed a <code>mediaobject</code> in a <code>figure</code>.
 
  
 
In DocBook source, here is how you include images that have both a scalable-for-print-resolution in the PDF and an online-resolution for the HTML output. In this case the two types of images are SVG and PNG formats. The contentwidth="6in" attribute ensures that the image does not overlap print margins nor take up too much screen space.
 
In DocBook source, here is how you include images that have both a scalable-for-print-resolution in the PDF and an online-resolution for the HTML output. In this case the two types of images are SVG and PNG formats. The contentwidth="6in" attribute ensures that the image does not overlap print margins nor take up too much screen space.
Line 439: Line 471:
 
'''Use tag''': any element, with <code>os</code> attribute
 
'''Use tag''': any element, with <code>os</code> attribute
  
The ''Install & Deploy Guide'' has content that depends upon the operating system. Use the <code>os</code> attribute to specify a region that is operating-system specific. Valid values are:
+
The ''Install & Deploy Guide'' has content that depends upon the operating system. Use the <code>os</code> attribute to specify an element that is operating-system specific. Valid values are:
  
 
* ubuntu
 
* ubuntu
Line 456: Line 488:
 
'''Example''':
 
'''Example''':
  
A sequence of two or more menu selections. Output automatically includes a '''>''' separator between items.
+
=== Menu sequence ===
 +
Represents the action of navigating a menu to choose an item one or more levels down. Output automatically includes a '''''' separator between items.
  
<pre><nowiki><para>Here's an example openrc file you can download from the Dashboard in
+
<pre><nowiki><para>To download an openrc file in the Dashboard, click
 
<menuchoice>
 
<menuchoice>
 
   <guimenu>Settings</guimenu>
 
   <guimenu>Settings</guimenu>
Line 465: Line 498:
 
</menuchoice>
 
</menuchoice>
 
.</para></nowiki></pre>
 
.</para></nowiki></pre>
 +
 +
The output looks like this:
 +
To download an openrc file in the Dashboard, click Settings → Project Settings → Download RC File.
  
 
=== Keyboard key combination ===
 
=== Keyboard key combination ===
Line 473: Line 509:
 
'''Example'''
 
'''Example'''
  
<pre><nowiki><keycombo>
+
<pre><nowiki><para>Click <guibutton>Search</guibutton> or press
 +
<keycombo>
 
   <keycap>Ctrl</keycap>
 
   <keycap>Ctrl</keycap>
 
   <keycap>F1</keycap>
 
   <keycap>F1</keycap>
</keycombo></nowiki></pre>
+
</keycombo>
 +
.</para></nowiki></pre>
  
 +
The output looks like this:
 +
Click Search or press '''Ctrl+F1'''.
 
=== GUI button ===
 
=== GUI button ===
 
'''Use tag''': <code>guibutton</code>
 
'''Use tag''': <code>guibutton</code>

Revision as of 14:31, 9 August 2013

DocBook markup conventions

This page offers writing conventions for OpenStack documentation. Following conventions helps to enhance the readabilty of our docs by enabling the DocBook stylesheets to format them consistently. Please modify this page as you come across more markup you need for the docs.openstack.org site.

General authoring conventions

This section contains general guidelines for editing OpenStack documents in DocBook.

Maximum line length in verbatim text

When using verbatim elements (including literallayout, programlisting, screen, and synopsis), do not exceed a line length of 70 characters.

Boolean configuration options

When documenting boolean configuration options, explicitly include the truth value.

Correct example

force_dhcp_release=True
use_ipv6=False

Incorrect example

force_dhcp_release
nouse_ipv6

Sections

Add IDs to sections

All section tags must have an xml:id attribute. This enables unique file names for the generated HTML and human-readable page titles, plus it lets Disqus threads stay with the HTML page.

Example

<section xml:id="section-id-goes-here">
...
</section>

Keeping sections together

To keep several sections on a single HTML page, use the DocBook stop_chunking processing instruction:

Example

<section xmlns="http://docbook.org/ns/docbook"
    xmlns:xi="http://www.w3.org/2001/XInclude"
    xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
    xml:id="xapi-resize-setup">
<?dbhtml stop-chunking?>
<title>Dom Modifications for Resize/Migration Support</title>
 ...

euca2ools documentation

Since Nova exposes both its own API and an EC2-compatible API, many tasks can be executed using either the nova CLI or euca2ools. Documentation related to euca2ools should generally be limited to:

  • Describing euca2ools commands that don't yet have a nova CLI equivalent (e.g., euca-get-console-output)
  • Describing how to get credentials to work with euca2ools
  • Describing differences between how Amazon's EC2 endpoint behaves and how an OpenStack endpoint behaves when accessing via EC2.

Adding a line break

The output of verbatim elements like screen and programlisting preserves the whitespace that you enter in the source, including line breaks.

In the output of non-verbatim elements (such as paragraphs and table cells), lines normally break automatically, for example at a fixed page or table boundary or when the reader resizes an HTML page. Automatic line breaking can fail if the text contains long strings that contain no whitespace. When that happens, the text is clipped or overflows the page or table boundaries.

If a line fails to break normally in output, try adding whitespace (like spaces) in the source where you want to allow line breaks. If that method is not available, you can force a line break anywhere in text by inserting the <?sbr?> processing instruction.

Example

In the first line of code, spaces around the equals signs enable the line to wrap at either location. In the second line, <?sbr?> forces a line break.

<programlisting>
compute_driver = nova.virt.baremetal.driver.BareMetalDriver
scheduler_host_manager=nova.scheduler.baremetal_host_manager.<?sbr?>BaremetalHostManager
</programlisting>

Tagging

Choosing the right tags (or at least agreeing to use the same tags) is important for using DocBook effectively. Otherwise, readers get inconsistent visual cues in the output formatting. You can check the semantic description of any tag in Oxygen. This section tries to identify circumstances where multiple tags might work or where the choice of tags is not obvious, and suggests an appropriate tagging.

Code or data (block)

Use tag: programlisting

Program source or source fragments formatted as a standalone block. (For inline source fragments see Code or data (inline). Whitespace in the source, including spaces, tabs, and line breaks, is preserved in the output. Text is usually displayed in a fixed-width font.

Example

<programlisting>config-file-example=asdf
foo=bar
hello=world</programlisting>

To optimize the output of programlisting for a specific programming language, use the language attribute. Valid language values include bash, java, json, and xml.

Examples

<programlisting language="json"><xi:include href="samples/agents-put-res.json" parse="text"/></programlisting>

<programlisting language="bash" linenumbering="unnumbered">CACHES = {
  'default': {
    'BACKEND' : 'django.core.cache.backends.memcached.MemcachedCache',
    'LOCATION' : '127.0.0.1:11211'
  }
}
</programlisting>

Code or data (inline)

Use tag: literal

A fragment of code within a line of text. If you are telling or expecting users to enter the code or data, use userinput instead.

Examples

<para>The file contains the default setting, <literal>use_syslog = True</literal>.</para>
  
<para>The owner is typically set to <literal>root:nova</literal>, and the mode set to 
<literal>0640</literal>.</para>

User input

Use tag: userinput

Text that you instruct or intend users to enter. Compare to code or programlisting, which simply shows an instance of code or data, without telling users to enter it.

You can insert a short userinput into a line of text (such as a para). For multiline input, embed userinput in a screen element, where you can insert line breaks to create each line.

Example

<para>Enter <userinput>admin</userinput> for the username and <userinput>secret</userinput> as the password.</para

See Computer output for a multiline example.

Computer output

Use tag: computeroutput

Text displayed in a terminal or log file as the result of a command. You can insert a short computeroutput string into a line of text. For multi-line input, embed computeroutput in a screen element, inserting line breaks to create each line.

Example

This interactive terminal session combines a prompt, user input, and the resulting computer output in a screen:

<para>Mount the image in read-write mode by entering, as root:</para>
<screen><prompt>#</prompt> <userinput>guestfish --rw -a centos63_desktop.img</userinput>
<computeroutput>
Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

><fs></computeroutput>
</screen>

Command

Use tag: command

The name of an executable program.

Example

<para>Use the <command>nova network-create</command> command to create the subnet that the VMs reside on.</para>

Command line prompt

Use tag: prompt

Example

<screen><prompt>$ </prompt><userinput>sudo addgroup nova</userinput></screen>

File name or path

Use tag: filename

Any part of a path specification, including device name, directory, file name, or extension.

Examples

<para>The configuration file <filename>nova.conf</filename> is installed in <filename>/etc/nova</filename> by default.</para>

Variable text

Use tag: replaceable

Variable content that readers replace with actual instances. The text is frequently italicized in output.

Example

<para>The <filename>/etc/<replaceable>service-codename</replaceable>/policy.json</filename> controls what users are allowed to do for a given service.

Note: Don't add formatting to replaceable text, for example by surrounding it with quotes or brackets. Let the DocBook style sheets do the formatting.

System and API names

Use tag: systemitem

Operating system or API components that you refer to by name, including system services, daemons, methods, classes, and functions. To refer to an item's location rather than its name, use filename instead.

Example

<para>Compute uses the <systemitem>nova-scheduler</systemitem> service to determine how to dispatch compute and volume requests.</para>

Linking

Link to an internal target that has a title

Use tag: xref

Cross-reference an element, in the same document, that can automatically provide the link text. The "hot" link text that appears in the output is generated automatically from the target object during processing. For this reason, xref usually point to targets that have a title or a associated label (such as a numbered step in a procedure).

Compare this to a cross reference using link, where you specify the link text yourself. The advantage of using xref is that the link text is not static: if the title of the target changes, your link text is automatically updated in the next build.

Note that the xref linkend attribute points to the xml:id of the target element, not its title.

Example

The xref in this example points to the figure that follows. In the output, the target title, OpenStack Services, is automatically used as the link text of the cross-reference:

<para>The Image Service is central to the overall IaaS picture, as shown in <xref linkend="concept_arch"/>.</para>
...
<figure xml:id="concept_arch"> 
  <title>OpenStack Services</title>
  <mediaobject>
    <imageobject>
      <imagedata
        fileref="figures/openstack-arch-grizzly-v1-conceptual.jpg"
        contentwidth="6in"/>
    </imageobject>
  </mediaobject>
</figure>

If the target in this example were an informalfigure, which has no title, the output would show "???" as the link text. which is probably not what you want. (For workarounds to this limitation, see the DocBook xref reference.)


Link to an internal target or external resource

Use tag: link

Cross-reference another element (which may or may not have a title) in the same document, or link to an external resource like an HTML page or PDF document. In the content of the link specify the "hot" text that you want to appear in the output.

  • To cross-reference an internal target, in the linkend attribute specify the target element's xml:id.
  • To cross-reference an external target, in the xlink:href attribute specify a URI that points to the target.

Examples

This cross-reference points to an external resource and displays the link text, Nova

<link xlink:href="http://nova.openstack.org">Nova</link>

This cross-reference points to an informal table in the same document, and specifies the link text, OpenStack Services:

<para>The Image Service is central to the overall IaaS picture, as shown in <link linkend="concept_arch2">OpenStack Services</link>.</para>
...
<informalfigure xml:id="concept_arch2"> 
  <mediaobject>
    <imageobject>
      <imagedata
        fileref="figures/openstack-arch-grizzly-v1-conceptual.jpg"
        contentwidth="6in"/>
    </imageobject>
  </mediaobject>
</informalfigure>

As a rule of thumb, use link instead of xref to cross-reference internal targets for which DocBook processing does not automatically generate link text (for example elements without titles). Conversely, if you're cross-referencing an internal target that has a title or label, consider using xref instead of hard-coding the link textlink.

Unlinked URI

Use tag: uri

Provide only the text of a URI, without a live link.

Example

<para>In your Web brower, log in to the Dashboard at <uri>http://192.168.206.130</uri>. </para>

Procedure

Tag to use: procedure

A formal (titled) sequence of steps. Normally, the steps are rendered as a numbered list in the output.

Begin the title with the word, "To", and do not end the title with a colon. Individual steps don't require titles, and step titles do not have to start with "To."

To reduce the number of steps and make long procedures easier to follow, consider breaking steps up into logical groups of substeps.

Example

<procedure>
  <title>To install the software</title>
  <step><para>Download the package.</para>
    <substeps>
      <step><para>Go to the download page.</para></step>
      <step><para>Choose the package for your environment and click <guibutton>Download</guibutton>.</para></step>
   </substeps>
 </step>
 <step><para>Unpack the downloaded file.</para></step>    
</procedure>

To indicate a choice of steps, use stepalternative. The alternative steps are rendered as a bulleted list in the output.

Example

Thanks to Bob Stayton for this clear illustration:

<procedure>
  <step><para>Do part A</para></step>
  <step><para>Do one of these:</para>
    <stepalternatives>
      <step><para>Do part B</para></step>
      <step><para>If you can't do part B, do part C</para></step>
    </stepalternatives>
  </step>  
</procedure>  

Lists

Choose the appropriate list type to presenting a sequence of items. Note: to present steps in a formal task, use procedure instead.

Ordered list

Use tag: orderedlist

A sequence of items whose order matters.

Example

<para>During the migration process:</para>
<orderedlist>
  <listitem><para>The target host ensures that live migration is enabled.</para></listitem>
  <listitem><para>The target host installs the base VHD if it is not already present.</para></listitem>
  <listitem><para>The source host ensures that live migration is enabled.</para></listitem>
  <listitem><para>The source host initiates the migration.</para></listitem>
  <listitem><para>The source host notifies the manager of the outcome of the operation.</para></listitem>
</orderedlist>

Unordered list

Use tag: itemizedlist

A sequence of items that can happen in any order or whose order doesn't matter.

Example

<para>OpenStack with XenAPI supports the following virtual machine image formats:</para>
<itemizedlist>
  <listitem><para>Raw</para></listitem>
  <listitem><para>VHD (in a gzipped tarball)</para></listitem>
</itemizedlist>

Term/description or key/value pairs

Use tag: variablelist

An unordered list in which each item has a short term (such as a key or option) or phrase, followed by a block that describes it. variablelist is typically rendered as a dl definition list in HTML output, with the term highlighted.

Consider using a variable list:

  • Instead of an itemized list when your list has a regular pattern of key/value or term/definition pairs.
  • Instead of a two column table where the first column lists items of a consistent type, such as keys, options, or short terms, and the second column describes the items. Consider that lists are generally more accessible than tables for screen reader users.

Example

<para>The system has these components:</para>
<variablelist>
  <varlistentry><term>Component A</term>
    <listitem><para>Description of A.</para></listitem>
  </varlistentry>
  <varlistentry><term>Component B</term>
    <listitem><para>Description of B.</para></listitem>
  </varlistentry>
  <varlistentry><term>Component C</term>
    <listitem><para>Description of C.</para></listitem>
  </varlistentry>
</variablelist>

A simple, undecorated list of items

Use tag: simplelist

Present a sequence of words or short phrases without the decorations of a numbered or bulleted list. simplelist offers a variety of flavors.

Example (default vertical list)

<para>Valid formats include:</para>

  <simplelist>
    <member>PNG</member>
    <member>JPG</member>
    <member>GIF</member>
    <member>SVG</member>
  </simplelist>

By default, this example is rendered as a standalone block of undecorated items, like this:

Valid formats include:
PNG
JPG
GIF
SVG 

Example (inline list)

You can also render a comma-separated list in a paragraph, by adding the type="iinline" attribute:

<para>Valid formats include 
  <simplelist type='inline'>
    <member>PNG</member>
    <member>JPG</member>
    <member>GIF</member>
    <member>SVG</member>
  </simplelist>
</para>

The output looks like this:

Valid formats include PNG, JPG, GIF, SVG.

Notes

Use tag: note, caution, important, tip, or warning

A brief message that is set off from the main text. Use note for generic messages; the others have more specific semantic meanings, as their names indicate. By default, these elements automatically generate a title (Note, Caution, and so on.) You can customize the title by explicitly adding a title element.

Example

The title element in this example overrides the default title, Note:

<note><title>Upcoming Changes</title>
    <para>Future versions of this feature may not be backward compatible. Consider implementing the revised interface now.
  </para>
</note>

Image

Use tag: mediaobject

Use mediaobject for a block image. For a formal (titled) image, embed a mediaobject in a figure.

Note: inlinemediaobject inserts an image in a text block, such as a paragraph. For our docs, mediaobject is usually the better choice: inlinemediaobject is typically used for small inline graphics (like icons) or to achieve floating effects, and requires some care to use correctly.


In DocBook source, here is how you include images that have both a scalable-for-print-resolution in the PDF and an online-resolution for the HTML output. In this case the two types of images are SVG and PNG formats. The contentwidth="6in" attribute ensures that the image does not overlap print margins nor take up too much screen space.

<figure xml:id="CFinterfaces">
  <title>Cloud Files System Interfaces</title>
  <mediaobject>
    <imageobject>
      <imagedata contentwidth="6in" fileref="figures/CFinterfaces.svg"/>
    </imageobject>
  </mediaobject>
</figure>

The convention is to use the /src/figures/ directory to store both the source image and any other formats of that same image. The pom.xml file copies the files in the /figures/ directory into the output directory required for HTML in the post processing section.

Also, when you add the image to the /src/figures directory, be sure to tell the source control system that you've added the image. For example, use git add to ensure the images get added to source control so the HTML and PDF output will be built correctly by the Jenkins continuous integration server.

For any figure you create, please also include the source files, even if the image was not created with open source tools, for maintenance purposes. While all OpenStack docs are created with open source in mind, including open-licensed fonts in the output, we are willing to allow non-open authoring or image creation tools if it's more efficient.

Tables

Use tag: table, informaltable

Use table for a formal (titled) table, informaltable for a table with no title.

Use sentence capitalization for table captions and column headings.

Example

<table rules="all">
  <caption>Hardware recommendations </caption>
  <col width="20%"/>
  <col width="23%"/>
  <col width="57%"/>

  <thead>
    <tr>
      <td>Server</td>
      <td>Recommended hardware</td>
      <td>Notes</td>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><para>...</para></td>
      ...
    </tr>
   </tbody>
</table>

Conditionalizing

Use tag: any element, with os attribute

The Install & Deploy Guide has content that depends upon the operating system. Use the os attribute to specify an element that is operating-system specific. Valid values are:

  • ubuntu
  • fedora
  • rhel
  • centos
  • deb

Examples

<screen os="ubuntu"><userinput><prompt>$</prompt> sudo apt-get install -y ntp</userinput></screen>

<screen os="rhel;fedora;centos"><prompt>$</prompt> <userinput>yum install -y ntp</userinput></screen>

Use tag: menuchoice

Example:

Menu sequence

Represents the action of navigating a menu to choose an item one or more levels down. Output automatically includes a separator between items.

<para>To download an openrc file in the Dashboard, click 
<menuchoice>
  <guimenu>Settings</guimenu>
  <guimenuitem>Project Settings</guimenuitem>
  <guimenuitem>Download RC File</guimenuitem>
</menuchoice>
.</para>

The output looks like this:

To download an openrc file in the Dashboard, click Settings → Project Settings → Download RC File.

Keyboard key combination

Use tag: keycombo

A sequence of two or more keystrokes or mouse actions. Output automatically includes a + separator between items.

Example

<para>Click <guibutton>Search</guibutton> or press 
<keycombo>
  <keycap>Ctrl</keycap>
  <keycap>F1</keycap>
</keycombo>
.</para>

The output looks like this:

Click Search or press Ctrl+F1.

GUI button

Use tag: guibutton

An item in a window that you select or click.

Example

<para>In the TryStack dashboard, click <guibutton>Login</guibutton>.</para>

Terms and usage

This section offers conventions around general English usage and terms that are not covered in the glossary.


hostname

Use lowercase unless legal considerations require capitalizing.

Example

"local-hostname": "test.novalocal"

OpenStack, not Openstack or openstack

Service and project names

When referring to the services, use "Compute", "Image", and "Identity" instead of "nova", "glance", and "keystone". Use the project names like "nova" and "keystone" when referring to the project or for CLI commands and service names.