2. Component Docs Guide

In the past, standard documentation methods included ad-hoc Word documents, PDFs, poorly organized wikis, and other, often closed, tools like Adobe FrameMaker. The rise of DevOps, Agile, and Continuous Integration, however, created a paradigm shift for those who care about documentation because:

1. Documentation must be tightly coupled with code/product releases. In many cases, particularly with open-source products, many different versions of the same code can be installed in various production environments. DevOps personnel must have access to the correct version of documentation.

2. Resources are often tight, volunteers scarce. With a large software base like Acumos, a small team of technical writers, even if they are also developers, cannot keep up with a constantly changing, large code base. Therefore, those closest to the code should document it as best they can, and let professional writers edit for style, grammar, and consistency.

Plain-text formatting syntaxes, such as reStructuredText (RST), are a good choice for documentation because:

  1. They are editor agnostic
  2. The source is nearly as easy to read as the rendered text
  3. Documentation can be treated exactly as source code is treated
  4. Shallow learning curve

The Documentation team chose reStructuredText largely because of Sphinx, a Python-based documentation build system, which uses reStructuredText natively. In a code base as large as Acumos’, cross-referencing between component documentation was deemed critical. Sphinx and reStructuredText have built-in functionality that makes collating and cross-referencing component documentation easier.

The Sphinx version is defined in `documentation/etc/requirements.txt`.

2.1. RST vs the Wiki - Which Docs Go Where

Frequently, developers ask where documentation should be created. Should they always use reStructuredText/Sphinx? Not necessarily. Is the wiki appropriate for anything at all? Yes.

It’s really up to the development team. Here is a simple rule:

The more tightly coupled the documentation is to a particular version of the code, the more likely it is that it should be stored with the code in reStructuredText.

Two examples on opposite ends of the spectrum:

Example 1: API documentation is often stored literally as code in the form of formatted comment sections. This would be an ideal choice for reStructuredText stored in a docs repo.

Example 2: Meeting notes, release plans – the wiki would be a better choice for this.

../_images/doc-places.png

The Docs team encourages component teams to store as much documentation as reStructuredText as possible because:

  1. The Docs team can more easily edit component documentation for grammar, spelling, clarity, and consistency
  2. A consistent formatting syntax across components will allow the doc team more flexibility in producing different kinds of output
  3. The documentation can easily be reorganized
  4. Wiki articles tend to grow stale over time as the people who write them change positions or projects

2.2. RST Tools and Resources

For detailed information ReStructuredText and how to best use the format, see:

A list of RST tools is available on the Tools for Creating Documentation in RST page.

2.3. Component Docs Structure

Each component should have a docs folder with a minimum of:

../_images/docs-structure.png

2.3.1. Required Files

  1. index.rst is the table of contents

  2. release-notes.rst contains the release notes for the component

  3. developer-guide.rst contains information that a developer needs to know in order to work on the component

    1. this should be very technical, aimed at people who want to help develop the components
    2. this should be how the component does what it does, not a requirements document of what the component should do
    3. this should contain what language(s) and frameworks are used, with versions
    4. this should contain how to obtain the code, where to look at work items (Jira tickets), how to get started developing
  4. api-docs.rst contains details on the component’s API

2.3.2. Optional Files

#. user-guide.rst contains information on how to use and configure the component; most components will not have a user guide

  1. if the guide contains sections on third-party tools, is it clearly stated why the Acumos platform is using those tools? are there instructions on how to install and configure each tool/toolset?
  2. does the guide state who the target users are? for example, modeler/data scientist, Acumos platform admin, marketplace user, design studio end user, etc
  3. if there are instructions, they are clear, correct, and fit for purpose
  4. does the guide contain information more suited for a different guide?
  5. a user guide should be how to use the component or system; it should not be a requirements document
  6. a user guide should contain configuration, administration, management, using, and troubleshooting sections for the feature.

2.3.3. Templates

Templates are available in the documentation project under docs/docs-contributor-guide/templates. You can clone the documentation project or download the templates from Github.

Current list of templates:

The templates themselves also contain guidance on what topics to include in the contents. Please read the contents of the templates!

2.4. Writing Guidelines

Following these writing guidelines will keep Acumos documentation consistent and readable. Only a few areas are covered below, as we don’t want to make it too complex. You can’t go wrong keeping things simple and clear.

Don’t get too hung up on using correct style. We’d rather have you submit good information that doesn’t conform to this guide than no information at all. Acumos’ Documentation project team will be happy to help you with the prose.

2.4.1. General Guidelines for All Documents

  1. Use standard American English and spelling
  2. Use consistent terminology
  3. Write in the active voice, using present simple tense when possible
  4. Write objective, professional content
  5. Keep sentences and paragraphs short and clear
  6. Use a spell checker

2.4.2. Abbreviations and Acronyms

Write out the term the first time it appears in the document, immediately followed by the acronym or abbreviation in parentheses, i.e. ReStructuredText (RST). Then use the acronym in the rest of the document. In diagrams, if space allows, write out the full term. Use “an” before an acronym that begins with a vowel sound when spoken aloud; use “a” before an acronym that begins with a consonant sound when spoken aloud. Examples: an RST file, a PMML file.

2.4.3. GUI Elements

In general, write menu names as they appear in the UI. For example, if a menu or item name is all caps, then write it all caps in the document.

2.4.4. Headings (Titles)

  1. Use brief, but specific, informative titles
  2. Use capitalization; do not end with a period or colon
  3. Use a gerund to begin section titles if it makes sense. Examples: Configuring, Managing, Starting
  4. Use descriptive titles for tables and figures titles; do not number tables or figures; do not (in general) add titles for screen shots

Use the following to create the Document title:

  1. = with overline/underline

Use the following symbols to create headings:

  1. Section 1: * with overline/underline
  2. Section 1.1: - with underline
  3. Section 1.1.1: + with underline
  4. Section 1.1.1.1: ^ with underline

Consider rewriting the content if your document needs more than 4 levels of headings.

2.4.4.1. Non-Numbered Headings in RST

Below is an example of how to denote headings of various levels in RST.

See the Section Headers Example - No Automatic Numbering for how this renders in HTML.

=================
H1 Document Title
=================

***************
Section 1 Title
***************

Section 1.1 Title
-----------------

Section 1.1.1 Title
+++++++++++++++++++

Section 1.1.1.1 Title
^^^^^^^^^^^^^^^^^^^^^

Section 1.1.1.1 Title2
^^^^^^^^^^^^^^^^^^^^^^

Another Section at the 1.1.1 Level
++++++++++++++++++++++++++++++++++

How the Header is Underlined Makes all the Difference
+++++++++++++++++++++++++++++++++++++++++++++++++++++

Section 1.2 Title
-----------------

Section 1.2.1 Title
+++++++++++++++++++

Section 1.2.2 Title
+++++++++++++++++++

***************
Section 2 Title
***************

***************
Section 3 Title
***************

2.4.4.2. Automatically Numbered Headings in RST

RST supports automatic numbering of sections. Place the sectnum directive at the top of your page. See the 1   Section Headers Example - Automatic Numbering for how this renders in HTML. Note that RST considers the Document Title to be the first Header and will number it!

=================
H1 Document Title
=================

.. sectnum::
***************
Section 1 Title
***************

Section 1.1 Title
-----------------

Section 1.1.1 Title
+++++++++++++++++++

Section 1.1.1.1 Title
^^^^^^^^^^^^^^^^^^^^^

Section 1.1.1.1 Title2
^^^^^^^^^^^^^^^^^^^^^^

Another Section at the 1.1.1 Level
++++++++++++++++++++++++++++++++++

How the Header is Underlined Makes all the Difference
+++++++++++++++++++++++++++++++++++++++++++++++++++++

Section 1.2 Title
-----------------

Section 1.2.1 Title
+++++++++++++++++++

Section 1.2.2 Title
+++++++++++++++++++

***************
Section 2 Title
***************

***************
Section 3 Title
***************

If your guide has enough content, consider breaking it up into chapters, with one chapter per RST file. You will need to list each page in your index.rst. See Developer Guide with Automatically Numbered Sections for an example.

2.4.5. Task(s)

  1. Start task titles with an action word. Examples: Create, Add, Validate, Update.
  2. Use [Optional] at the beginning of an optional step.
  3. Provide information on the expected outcome of a step, especially when it is not obvious.
  4. Break down end-to-end tasks into manageable chunks.

2.4.6. Including Design Diagrams and Images

The developer-guide.rst template contains information and examples on how to incorporate design diagrams in your guide.