Jump to: navigation, search

Difference between revisions of "Documentation/Conventions"

(backend, back end, and back-end)
(53 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Warning|header=Warning|body=This page is deprecated. It is left here for reference.}}
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
Read the new content in [http://docs.openstack.org/contributor-guide/writing-style/general-writing-guidelines.html the Documentation Contributor Guide].
= Writing style =
== Use active voice ==
In general, write in active voice rather than passive voice.
* Active voice identifies the agent of action as the subject of the verb—usually the user.
* Passive voice identifies the recipient (not the source) of the action as the subject of the verb.<br /><br />
Active-voice sentences clarify the performer of an action and are easier to understand than passive-voice sentences. Passive voice is usually less engaging and more complicated than active voice. When you use passive voice, the actions and responses of the software can be difficult to distinguish from those of the user. In addition, passive voice usually requires more words than active voice.
=== Correct usage ===
After you install the software, start the computer.<br />
Click OK to save the configuration.<br />
Create a server.
=== Incorrect usage ===
After the software has been installed, the computer can be started.<br />
The configuration is saved when the OK button is clicked.<br />
A server is created by you.<br />
However, passive voice is acceptable in the following situations:
* Using active voice sounds like you are blaming the user. For example, you can use passive voice in an error message or troubleshooting content when the active subject is the user.
* The agent of action is unknown, or you want to de-emphasize the agent of action and emphasize the object on which the action is performed.
* Recasting the sentence in active voice is wordy or awkward.
=== Correct usage ===
If the build fails, the flavor might have been omitted.<br />
A flag was set incorrectly.<br />
(The messages can be generated by the product, the OS, or the database, and the source of the messages is not important to the user.)<br />
The product, OS, or database returns the messages.
=== Incorrect usage ===
If the build fails, you probably omitted the flavor.<br />
You set the flag incorrectly.<br />
The messages are returned.
== Use present tense ==
Users read documentation to perform tasks or gather information. For users, these activities take place in their present, so the present tense is appropriate in most cases. Additionally, present tense is easier to read than past or future tense.
Use future tense only when you need to emphasize that  something will occur later (from the users' perspective).
=== Correct usage ===
The product prompts you to verify the deletion.<br />
After you log in, your account  begins the verification process.<br />
=== Incorrect usage ===
The product will prompt you to verify the deletion.<br />
After you log in, your account will then begin the verification process.
== Write to you (the user) ==
Users are more engaged with documentation when you use second person (that is, you address the user as you). Second person promotes a friendly tone by addressing users directly. Using second person with the imperative mood (in which the subject you is understood) and active voice helps to eliminate wordiness and confusion about who or what initiates an action, especially in procedural steps.
Using second person also avoids the use of gender-specific, third-person pronouns such as he, she, his, and hers. If you must use third person, use the pronouns they and their, but ensure that the pronoun matches the referenced noun in number.
Use first person plural pronouns (we, our) judiciously. These pronouns emphasize the writer or OpenStack rather than the user, so before you use them, consider whether second person or imperative mood is more "user friendly." However, use we recommend rather than it is recommended or OpenStack recommends . Also, you can use we in the place of OpenStack if necessary.
Do not use first person to avoid naming the product or to avoid using passive voice. If the product is performing the action, use third person (the product as actor). If you want to de-emphasize the agent of action and emphasize the object on which the action is performed, use passive voice.
The first-person singular pronoun I  is acceptable in the question part of FAQs and when authors of blogs or signed articles are describing their own actions or opinions.
Do not switch person (point of view) in the same document.
=== Correct usage ===
To create a server, you specify a name, flavor, and image.<br />
To create a server, specify a name, flavor, and image. (imperative mood)<br />
=== Incorrect usage ===
Creating a server involves specifying a name, flavor, and image.<br />
To create a server, the user specifies and name, flavor, and image.<br />
== Avoid obscure non-English words and abbreviations ==
Some non-English words and abbreviations are difficult to translate, and some users might be unfamiliar with them. Some Latin abbreviations, like i.e., e.g., and etc., are unnecessarily vague. The following table lists terms and abbreviations to avoid, and their preferred alternatives.
=== Correct usage - remove "e.g." ===
* Create a server by using a Linux distribution. For example, use Fedora or Ubuntu.
* Create a server by using a Linux distribution, such as Fedora or Ubuntu.
=== Incorrect usage "e.g." ===
Create a server by using a Linux distribution, e.g. Fedora or Ubuntu.<br />
=== Correct usage - remove "etc." ===
The dashboard includes metrics such as CPU, network interfaces, and file systems.
=== Incorrect usage "etc." ===
The dashboard includes metrics such as CPU, network interfaces, file systems, etc.
== Specific spellings ==
Use these spellings:
* back-end (adjective), back end (noun)
* plug-in
Check also the glossary which is available [http://docs.openstack.org/glossary/content/glossary.html online] for proper spelling.
=== Command line versus command-line ===
Do not hyphenate command line when it is used as a noun.
'''Use:''' Type the following command at the command line and press Enter.
When used as an adjective, hyphenate it.
'''Use:''' The nova client is a command-line interface (CLI).
'''Note:''' If you need to use the spelled-out term for clarity, hyphenate it. However, you can use the abbreviation without first spelling out the term; it is a common abbreviation.
== Code conventions ==
=== No -y for package install ===
Do not use the "-y" option for package installation. Correct usage is "apt install package" or "yum install package" or "zypper install package"
= Terms and usage =
This section offers conventions around general English usage and terms that are not covered in the glossary.
== backend, back end, and back-end ==
In general, avoid. Use a more specific term such as server, operating system, or network.
However, if you do use it, use back end for the noun and back-end for the adjective.
Do not use backend.
<pre><nowiki>back-end members (adjective)
session back end (noun)</nowiki></pre>
== hostname ==
Use lowercase unless legal considerations require capitalizing.
<pre><nowiki>"local-hostname": "test.novalocal"</nowiki></pre>
== OpenStack, not Openstack or openstack ==
== Service and project names ==
When referring to the services, use "Compute," "Image Service" and "Identity" instead of "nova," "glance," and "keystone." Use the project names like "nova" and "keystone" when you refer to the project or the command-line interfaces (CLIs) and service names.
Here's the list of project names and their official names and capitalization:
* Ceilometer: Telemetry or Telemetry module
* Cinder: OpenStack Block Storage
* Glance: OpenStack Image Service
* Heat: Orchestration or Orchestration module
* Horizon: OpenStack dashboard
* Keystone: OpenStack Identity
* Neutron: OpenStack Networking
* Nova: OpenStack Compute
* Swift: OpenStack Object Storage
Generally the capitalization of the project team names like swift is lowercase. When used as a command-line-client name, lowercase is best. When used for the team or project name, typically it's not necessary to capitalize.
== Release names ==
Release Names should follow [[Releases|the wiki page]]. Particularly, the 9th release should be written Icehouse - a single word with only initial capital.
= 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.
=== Avoid long lines ===
Wrap source lines so that you do not have lines longer than 70 characters. There are exceptions for programlistings/screens that contain markup.
=== Maximum line length in verbatim text ===
When using verbatim elements (including <code>literallayout</code>, <code>programlisting</code>, <code>screen</code>, and <code>synopsis</code>), do not exceed a line length of 70 characters of printed characters.
=== Boolean configuration options ===
When documenting boolean configuration options, explicitly include the truth value.
'''Correct example'''
'''Incorrect example'''
=== Sections ===
==== Add IDs to sections ====
All section tags must have an <code>xml:id</code> 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.
<pre><section xml:id="section-id-goes-here">
==== Keeping sections together ====
To keep several sections on a single HTML page, use the DocBook <code>stop_chunking</code> processing instruction:
<pre><section xmlns="http://docbook.org/ns/docbook"
    xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
<?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 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 <code>screen</code> and <code>programlisting</code> 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 <code><?sbr?></code> processing instruction.
In the first line of code, spaces around the equals signs enable the line to wrap at either location. In the second line, <code><?sbr?></code> forces a line break.
<td>compute_driver = nova.virt.baremetal.driver.BareMetalDriver</td>
=== Avoiding empty lines in screen and programlistings ===
Since <code>screen</code> and <code>programlisting</code> preserve line breaks that you enter, you might get empty lines at the beginning/end of a text if you do not add the tags on the first/last line of the code.
'''Do not use'''
'''Use instead'''
<programlisting>LINE 1
LINE 2</programlisting>
=== Whitespace ===
Do not use tab characters in the code, always use spaces. For consistency, we like to have no extra whitespaces in the files, so do not place whitespaces at the following locations:
* End of line (trailing whitespace)
* after the opening or before the closing tag of elements listitem, para, td, th, command, literal, title, caption, filename, userinput, programlisting
You can test for whitespace in openstack-manuals with tools/validate.py.
== Tags ==
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.
=== Applications (inline) ===
'''Use tag:''' <code>application</code>
Describes software applications.
<pre><nowiki><para>You must configure the <application>RabbitMQ</application>.</para></nowiki></pre>
=== Code or data (block) ===
'''Use tag:''' <code>programlisting</code>
Program source or source fragments formatted as a standalone block. (For inline source fragments see [[#Code or data (inline)|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.
<pre><nowiki><programlisting>config-file-example = asdf
foo = bar
hello = world</programlisting></nowiki></pre>
To optimize the output of <code>programlisting</code> for a specific programming language, use the language attribute. Valid language values include <code>bash</code>, <code>ini</code>, <code>java</code>, <code>javascript</code>, <code>json</code>, <code>python</code>, and <code>xml</code>.
<pre><nowiki><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' : ''
Note: Since <code>programlisting</code> preserves line breaks, add the initial/last line of source code always together with the tag, otherwise an empty line will be inserted:
'''Do not use'''
'''Use instead'''
<programlisting>LINE 1
LINE 2</programlisting>
Note: For options and their values in configuration files, always add a space around the "=" sign:
<pre><nowiki><programlisting>option = value</programlisting></nowiki></pre>
=== Code or data (inline) ===
'''Use tag''': <code>literal</code> or <code>code</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.
<pre><nowiki><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
<para>To set the environment variable, run <code>export token="token"</code.</para></nowiki></pre>
=== User input ===
'''Use tag''': <code>userinput</code>
Text that you instruct or intend users to enter. Compare to <code>code</code> or <code>programlisting</code>, which simply shows an instance of code or data, without telling users to enter it.
You can insert a short <code>userinput</code> into a line of text (such as a para). For multiline input, embed <code>userinput</code> in a <code>screen</code> element, where you can insert line breaks to create each line.
<pre><nowiki><para>Enter <userinput>admin</userinput> for the username and <userinput>secret</userinput> as the password.</para></nowiki></pre>
If your command is too long, wrap it and add slashes so that users can copy and paste the line. Also, intent the following line with just a few, usually three, spaces:
<screen><prompt>$</prompt> <userinput>glance image-create --name ubuntu.iso \
  --is-public=True --container-format=bare \
  --disk-format=iso &lt; ubuntu-13.04-server-amd64.iso</userinput></screen>
See [[#Computer output|Computer output]] for another multiline example.
=== Computer output ===
'''Use tag''': <code>computeroutput</code>
Text displayed in a terminal or log file as the result of a command. You can insert a short <code>computeroutput</code> string into a line of text. For multi-line input, embed <code>computeroutput</code> in a <code>screen</code> element, inserting line breaks to create each line.
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>
<screen><prompt>#</prompt> <userinput>guestfish --rw -a centos63_desktop.img</userinput>
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
=== Commands, parameters, and variables ===
'''Use tags''': <code>command</code> and <code>parameter</code> and <code>replaceable</code>
Use for inline commands. Examples are inline sub-commands for the OpenStack nova, swift, or neutron command-line interfaces (CLIs) and inline Linux commands.
For variables, use all caps like <code><nowiki><replaceable>VARIABLE</replaceable></nowiki></code>. There is more information on [[#Variable text|variables here]].
'''Note''': You do not have to tag the OpenStack CLI name, such as nova. Use the <code>command</code> tag to tag the client sub-commands.
<pre><nowiki><para>To launch a virtual machine, use the nova <command>boot</command> command. Use the <parameter>--flavor</parameter> <replaceable>FLAVOR</replaceable> and <parameter>--image</parameter> <replaceable>IMAGE</replaceable> parameters to specify the IDs or names of the flavor and image to use for the image.</para></nowiki></pre>
=== Command line prompt ===
'''Use tag''': <code>prompt</code>
<pre><nowiki><screen><prompt>#</prompt> <userinput>addgroup nova</userinput></screen>
<screen><prompt>$</prompt> <userinput>glance image-list</userinput></screen></nowiki></pre>
Note there's a single space between the closing <code>prompt</code> and the opening <code>userinput</code>.
Always use the <code>#</code> prompt if the command '''needs''' root privileges to run. Don't use <code>sudo</code>.
Use the <code>$</code> prompt otherwise.
=== Configuration options (inline) ===
'''Use tag''': <code>option</code>
Describes configuration file options.
<pre><nowiki><para>Set the <option>backend</option> option in the <filename>nova.conf</filename> configuration file.</para></nowiki></pre>
=== File name or path ===
'''Use tag''': <code>filename</code>
Any part of a path specification, including device name, directory, file name, or extension.
<pre><nowiki><para>By default, the <filename>nova.conf</filename> configuration file is installed in the <filename>/etc/nova</filename> folder.</para></nowiki></pre>
=== Packages (inline) ===
'''Use tag:''' <code>package</code>
Describes software packages.
<pre><nowiki><para>You must install the <package>libvirt</package> package.</para></nowiki></pre>
=== Variable text ===
'''Use tag''': <code>replaceable</code>
Variable content that readers replace with actual instances. The text is frequently italicized in output.
For variables, use all caps like <code><nowiki><replaceable>VARIABLE</replaceable></nowiki></code>.
<pre><nowiki><para>The <filename>/etc/<replaceable>SERVICE-CODENAME</replaceable>/policy.json</filename> controls what users are allowed to do for a given service.</nowiki></pre>
Use <code>replaceable</code> also for values that are useable as-is but can be changed. For example the controller node is often called controller but some change it. Or an option like <code>storage_type=ephemeral</code> - where <code>ephemeral</code> is one of several valid types that you can choose.
rabbit_host = <replaceable>controller</replaceable>
rabbit_password = <replaceable>RABBIT_PASS</replaceable>
storage_type= <replaceable>ephemeral</replaceable>
'''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''': <code>systemitem</code>
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. You can use class="service" to further describe the name.
<pre><nowiki><para>Compute uses the <systemitem class="service">nova-scheduler</systemitem> service to determine how to dispatch compute and volume requests.</para></nowiki></pre>
=== Linking ===
==== Link to an internal target that has a title ====
'''Use tag''': <code>xref</code>
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.
Note that the <code>xref linkend</code> attribute points to the <code>xml:id</code> of the target element, not its title.
The <code>xref</code> 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:
<pre><nowiki><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>
If the target in this example were an <code>informalfigure</code>, 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 <code>xref</code> reference.)
==== Link to an internal target or external resource ====
'''Use tag''': <code>link</code>
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, in the <code>linkend</code> attribute specify the target element's <code>xml:id</code>.
* To cross-reference an external target, in the <code>xlink:href</code> attribute specify a URI that points to the target.
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>
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_arch2">OpenStack Services</link>.</para>
<informalfigure xml:id="concept_arch2">
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 ===
Technically, we should use the uri element as shown below, but our tool chain currently makes a live link, so use  <code>uri</code> sparingly if at all. Bug logged at https://bugs.launchpad.net/openstack-manuals/+bug/1221225.
'''Use tag''': <code>uri</code>
Provide only the text of a URI, without a live link.
<pre><nowiki><para>In your Web brower, log in to the Dashboard at <uri></uri>. </para></nowiki></pre>
=== Procedure ===
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. 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.
  <title>To install the software</title>
  <step><para>Download the package.</para>
      <step><para>Go to the download page.</para></step>
      <step><para>Choose the package for your environment and click <guibutton>Download</guibutton>.</para></step>
<step><para>Unpack the downloaded file.</para></step>   
To indicate a choice of steps, use <code>stepalternative</code>. The alternative steps are rendered as a bulleted list in the output.
To indicate an optional step, use <nowiki><step> (Optional) </step></nowiki> rather than the DocBook performance attribute.
''Thanks to Bob Stayton for this clear illustration:''
  <step><para>Do part A.</para></step>
  <step><para>Do one of these:</para>
      <step><para>Do part B.</para></step>
      <step><para>If you can't do part B, do part C.</para></step>
<step><para>Do part D.</para></step>
<step><para>(Optional) Do part E.</para></step>
</procedure>  </nowiki></pre>
Pull conceptual information into an overview before the procedure. Make the steps in the procedure concise.
Start each step with a verb. If the step includes a command example, end the introductory sentence with a colon (:).
<pre><nowiki><section xml:id="xxx"><title>Edit a file</title>
<para>Place concepts in an introductory paragraph before the procedure.</para>
<para>If you want, describe the overall flow in a couple of sentences.</para>
        <para>Navigate to the directory that contains the file.</para>
        <para>Open the file, where <replaceable>MY_FILE</replaceable> is the name of your file:</para>
        <screen><prompt>$</prompt> <userinput>open-file <replaceable>MY_FILE</replaceable></userinput></screen>
        <para>Edit the file.</para>
        <para>Make global changes:</para>
        <screen><prompt>$</prompt> <userinput>change-file xyz zyx</userinput></screen>
=== Lists ===
Choose the appropriate list type to presenting a sequence of items. You can nest lists, including lists of different types. '''Note''': to present steps in a formal task, use <code>procedure</code> instead.
==== Ordered list ====
'''Use tag''': <code>orderedlist</code>
A sequence of items whose order matters.
<pre><nowiki><para>During the migration process:</para>
  <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>
==== Unordered list ====
'''Use tag''': <code>itemizedlist</code>
A sequence of items that can happen in any order or whose order doesn't matter.
<pre><nowiki><para>OpenStack with XenAPI supports the following virtual machine image formats:</para>
  <listitem><para>VHD (in a gzipped tarball)</para></listitem>
==== Term/description or key/value pairs ====
'''Use tag''': <code>variablelist</code>
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:
* 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.
This example includes a nested variable list. Nesting lists of different kinds is a way of breaking up information into distinct visual and logical chunks:
    <para>The system exposes these components to users:</para>
      <varlistentry><term>Component A</term>
        <listitem><para>Description of A.</para></listitem>
      <varlistentry><term>Component B</term>
        <listitem><para>Description of B.</para></listitem>
      <varlistentry><term>Component C</term>
        <listitem><para>Description of C. Note: C is available only for these OS's:</para>
            <listitem><para>Mac OS X</para></listitem>
  <listitem><para>API libraries are also available.</para></listitem>
The example output looks something like this:
<pre><nowiki>* The system exposes these components to users:
  Component A
    Description of A.
  Component B
    Description of B.
  Component C
    Description of C.  Note: C is available only for these OS's:
    * Linux
    * Mac OS X
* API libraries are also available.</nowiki></pre>
''Note'': Any current usage of bulleted lists that consist of a short term and its definition, should be converted to variable lists.
For example, consider the following bulleted list entries:
* Spellchecking: process of correcting spelling
* Pagebreaking—process of breaking pages
These should be rewritten as variable list entries:
    Process of correcting spelling
    Process of breaking pages
==== A simple, undecorated  list of items ====
'''Use tag''': <code>simplelist</code>
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''' (default vertical list)
<pre><nowiki><para>Valid formats include:</para>
By default, this example is rendered as a standalone block of undecorated items, like this:
Valid formats include:
'''Example''' (inline list)
You can also render a comma-separated list in a paragraph, by adding the <code>type="inline"</code> attribute:
<pre><nowiki><para>Valid formats include
  <simplelist type='inline'>
The output looks like this:
Valid formats include PNG, JPG, GIF, SVG.
=== Notes ===
'''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 customize the title by explicitly adding a <code>title</code> element.
The title element in this example overrides the default title, '''Note''':
<pre><nowiki><note><title>Upcoming Changes</title>
    <para>Future versions of this feature may not be backward compatible. Consider implementing the revised interface now.
=== Headings ===
'''Use tag''': <code>title</code> in a <code>section</code> or <code>chapter</code>
Use <code>title</code> for a heading.
'''Note''': Use sentence-style capitalization for headings except for the Operations Guide, which follows [http://chimera.labs.oreilly.com/books/1230000000969/ch02.html#headings O'Reilly heading capitalization style].
For example:
'''Incorrect:''' Open a File
'''Correct:''' Open a file
For task topics, avoid gerunds (_ING_ verbs).
'''Incorrect''': Installing and Configuring Software
'''Correct''': Install and configure software
Do not organize your content so that headings are "stacked" -- meaning, there are two titles directly after each other with no text to introduce the reason for the second title.
=== Image ===
'''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.
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 <code>contentwidth="6in"</code> attribute ensures that the image does not overlap print margins nor take up too much screen space.
<pre><nowiki><figure xml:id="CFinterfaces">
  <title>Cloud Files System Interfaces</title>
      <imagedata contentwidth="6in" fileref="figures/CFinterfaces.svg"/>
Note: the <code>contentwidth="6in"</code> is used for all guides with the exception of the Training Guides. The Training Guides use <code>contentwidth="7in"</code> since the PDFs is in landscape.
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.
For many networking diagrams such as those in the admin guide, as a comment in the docbook there are links to Google Drawing images that are shared so that they can be edited by anyone with the link, then exported to PNG.
For the Operations Guide, the source files are .ai so we have not included them as they are not edited with open source tools. However, if you find an error we can get a copy of those images, and the original SVGs prior to the O'Reilly work are still available.
=== Tables ===
'''Use tag''': <code>table</code>, <code>informaltable</code>. Generally speaking we don't use CALS tables, using <tr> <td> markup.
Use <code>table</code> for a formal (titled) table, <code>informaltable</code> for a table with no title.
Use sentence capitalization for table captions and column headings.
Use <code>th</code> for headers - both column and row headers. Using <code>td</code> in headers works as well but <code>th</code> is preferred.
<pre><nowiki><table rules="all">
  <caption>Hardware recommendations </caption>
  <col width="20%"/>
  <col width="23%"/>
  <col width="57%"/>
      <th>Recommended hardware</th>
=== Profiling (conditional content) ===
'''Use tag''': any element, with <code>os</code> attribute, <code>audience</code> attribute, and so on. For all profiling attributes, see [http://www.sagehill.net/docbookxsl/Profiling.html DocBook: Chapter 26. Profiling (conditional text)].
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
* fedora
* rhel
* centos
* deb
<pre><nowiki><screen os="ubuntu"><prompt>$</prompt> <userinput>sudo apt-get install ntp</userinput></screen>
<screen os="rhel;fedora;centos"><prompt>$</prompt> <userinput>yum install ntp</userinput></screen></nowiki></pre>
[http://www.sagehill.net/docbookxsl/Profiling.html DocBook: Chapter 26. Profiling (conditional text)]
[http://docs.rackspace.com/writers-guide/content/ch_preface.html API Writers Guide]
=== Menu sequence ===
'''Use tag''': <code>menuchoice</code>
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>To download an openrc file in the Dashboard, click
  <guimenuitem>Project Settings</guimenuitem>
  <guimenuitem>Download RC File</guimenuitem>
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''': <code>keycombo</code>
A sequence of two or more keystrokes or mouse actions. Output automatically includes a '''+''' separator between items.
<pre><nowiki><para>Click <guibutton>Search</guibutton> or press
The output looks like this:
Click Search or press '''Ctrl+F1'''.
=== GUI button ===
'''Use tag''': <code>guibutton</code>
An item in a window that you select or click.
<pre><nowiki><para>In the TryStack dashboard, click <guibutton>Login</guibutton>.</para></nowiki></pre>
=== Glossary ===
'''Use tag''': <code>glossterm</code>
This marks a term as appearing in the glossary. Use the <code>baseform</code> attribute if the spelling of the term in the text and the glossary is different.
Note that not all guides include a glossary, currently the Operations Guide, the Security Guide and the Install Guides have a glossary. Before you mark a term with <code>glossterm</code>, check that it appears already in the shared glossary which is available [http://docs.openstack.org/glossary/content/glossary.html online] and as file glossary/glossary-terms.xml in the openstack-manuals repository. Please do not use the term <code>firstterm</code>.
<pre><nowiki>Several <glossterm baseform="user">users</glossterm> might be part of a single <glossterm>tenant</glossterm></nowiki></pre>
=== Entities ===
The common used entities are defined in the file doc/common/entities/openstack.ent. Include this file before using common entities and enhance it as needed. For examples of its usage, see the section [[#Numbers and units|Numbers and units]].
=== Numbers and units ===
Separate numbers and their units by a non-breaking space. Include the common entitites file with the definition of it.
<!DOCTYPE section [
<!ENTITY % openstack SYSTEM "../common/entities/openstack.ent">
1&amp;nbsp;TB, is 1024&amp;nbsp;GB.
=== Emdashes ===
Do not place spaces before and after emdashes. If you use emdashes, please use the <code>&amp;mdash;</code> entitity.
<!DOCTYPE section [
<!ENTITY % openstack SYSTEM "../common/entities/openstack.ent">
OpenStack dashboard&amp;mdash;Project tab
= Guide Conventions =
The following lists conventions used for writing specific guides. In general we want to be consistent between guides, especially since some guides include the same files.
== General ==
* Mentioning Bugs. If there is a bug that causes some workaround or limitation to be documented, the link to the bug report should be included. This makes it easier to maintain and update such notes.
== Install Guide ==
* Use <code>controller</code> instead of the controller node management interface IP address Use replaceable for it like <code><nowiki><replaceable>controller</replaceable></nowiki></code>.
* Use <code>compute''X''</code> instead of the compute node management interface IP address for compute nodes. Replace X with a number starting from 1. The management interface IP address of the first compute node is, the second is, etc.
* Use <code>block''X''</code> instead of the block storage node management interface IP address for block storage nodes. Replace X with a number starting from 1. The management interface IP address of the first block storage node is, the second, etc.
* Use <code>object''X''</code> instead of the object storage node management interface IP address for object storage nodes. Replace X with a number starting from 1. The management interface IP address of the first object storage node is, the second, etc.
* Try to reference the name of a network interface as described in the architecture chapter. For example, say "configure the management interface IP address as" rather than "configure eth0 as".
* The example IP addressing structure allows up to 10 controller nodes, network nodes, compute nodes, block storage nodes, and object storage nodes.
* Database passwords are written as <code>''SERVICE''_DBPASS</code>, e.g. <code>NOVA_DBPASS</code>
* Keystone passwords are written as <code>''USERNAME''_PASS</code>, e.g. <code>GLANCE_PASS</code>
* <code>rabbit_userid</code> is <code>guest</code>
* Networking services
** Use "OpenStack Networking (neutron)" for chapter/section titles and first instance. Use "OpenStack Networking" or "Networking" for additional instances.
** Use "legacy networking (nova-network)" for chapter/section titles and first instance. Use "legacy networking" for additional instances.
* Structure for steps that involve commands:
<pre>1) Run the following command to install the components:
    a) apt-get install package1 package2</pre>
* Structure for steps that involve configuration:
<pre>1) Edit the /etc/abc/abc.conf file:
    a) Configure database access in the [database] section:
        connection = mysql://
    b) Configure RabbitMQ message broker access in the [DEFAULT] section:
        rabbit_host = controller
    c) Configure Identity service access in the [keystone_authtoken] section:
        auth_host = controller</pre>
** Example code snippet for editing /etc/heat/heat.conf:
<pre><procedure os="ubuntu;rhel;centos;fedora;sles;opensuse">
  <title>To configure the Orchestration components</title>
  <para>Edit the <filename>/etc/heat/heat.conf</filename> file and perform
    the following tasks:</para>
    <para>Configure database access in the <literal>[database]</literal>
    <para>Replace <replaceable>HEAT_DBPASS</replaceable> with the password
      you chose for the Orchestration database.</para>
    <programlisting language="ini">[database]
connection = mysql://heat:<replaceable>HEAT_DBPASS</replaceable>@<replaceable>controller</replaceable>/heat</programlisting>
  <step os="ubuntu;sles;opensuse">
    <para>Configure <application>RabbitMQ</application> message broker
      access in the <literal>[DEFAULT]</literal> section:</para>
    <para>Replace <replaceable>RABBIT_PASS</replaceable> with the password
      you chose for the <literal>guest</literal> account in
    <programlisting language="ini">[DEFAULT]
rpc_backend = heat.openstack.common.rpc.impl_kombu
rabbit_host = <replaceable>controller</replaceable>
rabbit_password = <replaceable>RABBIT_PASS</replaceable></programlisting>
== Operations Guide ==
The Operations Guide follows for some cases the [http://chimera.labs.oreilly.com/books/1230000000969/ch02.html  O'Reilly style guide].
= Source file names and xml:id creation =
For file names, use bk_, ch_, sec_, and app_ at the beginning of the file name to indicate the type of file it is in the hierarchy of the build. For further organization, you can use subdirectories to organize the files by a particular grouping such as project or topic.
For xml:id creation, follow these guidelines:
* xml:id must be unique across a built deliverable, otherwise you get build errors
* xml:id creates the HTML file name so it should be human-readable, not codified like the file name
* xml:id should closely follow the actual title in the text, using dashes for spaces
* xml:id creation should consider search and find-ability as well as human-readability
= WADL markup conventions =
See this separate page for [[Documentation/Conventions/WADL|WADL conventions]].
= JSON formatting conventions =
Format JSON files to be human readable. Use four spaces for indentation (matching OpenStack conventions used in Python and shell scripts), and one space after the name-separator (colon). Obey the formal JSON format; in particular, strings are in double (not single) quotes.
Sample files may have their keys ordered if that makes the file easier to understand. Automatic reformatting tools are to preserve the order of keys.
    "uuid": "d8e02d56-2648-49a3-bf97-6be8f1204f38",
    "availability_zone": "nova",
    "hostname": "test.novalocal",
    "launch_index": 0,
    "array0": [],
    "array1": [
    "array3": [
    "object0": {},
    "object1": {
        "value": "low",
        "role": "some"
    "name": "test"

Latest revision as of 13:47, 27 March 2018

Warning icon.svg Warning

This page is deprecated. It is left here for reference.

Read the new content in the Documentation Contributor Guide.