+

Search Tips   |   Advanced Search

Ansible style guide

Welcome to the Ansible style guide! To create clear, concise, consistent, useful materials on docs.ansible.com, follow these guidelines:


Linguistic guidelines

We want the Ansible documentation to be:

We want reading the docs to feel like having an experienced, friendly colleague explain how Ansible works.


Stylistic cheat-sheet

This cheat-sheet illustrates a few rules that help achieve the 'Ansible tone':

Rule

Good example

Bad example

Use active voice You can run a task by A task can be run by
Use the present tense This command creates a This command will create a
Address the reader As you expand your inventory When the number of managed nodes grows
Use standard English Return to this page Hop back to this page
Use American English The color of the output The colour of the output


Header case

Headers should be written in sentence case. For example, this section's title is Header case, not Header Case or HEADER CASE.


Avoid using Latin phrases

Latin words and phrases like e.g. or etc. are easily understood by English speakers. They may be harder to understand for others and are also tricky for automated translation.

Use the following English terms in place of Latin terms or abbreviations:

Latin

English

i.e in other words
e.g. for example
etc and so on
via by/ through
vs./versus rather than/against


reStructuredText guidelines

The Ansible documentation is written in reStructuredText and processed by Sphinx. We follow these technical or mechanical guidelines on all rST pages:


Header notation

Section headers in reStructuredText can use a variety of notations. Sphinx will 'learn on the fly' when creating a hierarchy of headers. To make our documents easy to read and to edit, we follow a standard set of header notations. We use:


Internal navigation

Anchors (also called labels) and links work together to help users find related content. Local tables of contents also help users navigate quickly to the information they need. All internal links should use the :ref: syntax. Every page should have at least one anchor to support internal :ref: links. Long pages, or pages with multiple levels of headers, can also include a local TOC.

Adding anchors

Adding internal links

The second example adds custom text for the link.

Adding links to modules and plugins

Ansible 2.10 and later require the extended Fully Qualified Collection Name (FQCN) as part of the links:

For example:

    :ref:`ansible.builtin.first_found lookup plugin <ansible_collections.ansible.builtin.first_found_lookup>`
    

displays as ansible.builtin.first_found lookup plugin.

Modules require different suffixes from other plugins:

ansible.builtin is the FQCN for modules included in ansible.base. Documentation links are the only place you prepend ansible_collections to the FQCN. This is used by the documentation build scripts to correctly fetch documentation from collections on Ansible Galaxy.

Adding local TOCs

The page you're reading includes a local TOC. If you include a local TOC:

The syntax is:


More resources

These pages offer more help with grammatical, stylistic, and technical rules for documentation.


See also

Contributing to the Ansible Documentation

How to contribute to the Ansible documentation

Testing the documentation locally

How to build the Ansible documentation

irc.freenode.net

#ansible-docs IRC chat channel

Next Previous