Contributing to Documentation#

Using Sphinx#

IMAP uses Sphinx to generate and maintain documentation. Sphinx allows for automatic usage of Python docstrings, as well features for hierarchical structure, automatic code highlighting, and different output formats.

To add a new documentation file, create a new .rst file under docs/source. RST stands for Restructured Text, which is a type of rich text format used by Sphinx. It is a flexible and powerful format which allows for lots of features which are useful in documentation.

For more information on restructured text, Sphinx has extensive documentation.

Documentation Style#

Here are the main rules for documentation in IMAP:

  1. Keep it short and simple

  2. Link to other docs, don’t rewrite

  3. Write in clear english

  4. Use document hierarchy to organize information

Keep it short and simple#

Keep documentation to the minimal length that is required. You want to keep the documentation to the point so it is easy to link to specific topics. This prevents duplicate info, which helps keep documentation clear and up to date. In general, if there’s doubt that a particular section is directly relevant to the overall page, split it out to its own page and link it. Additionally, if the section might be useful to other documents, please put it into its own document.

Write in clear english#

To allow for everyone to understand documentation, write clearly and informally. Obviously technical documentation often uses jargon or acronyms, but where it is possible, please try and keep the documentatation simple and well-formatted.

Tip

Noting particularly important pieces of information in special formats, like this tip box, helps with formatting and clarity.

Use document hierarchy to organize information#

Documents should be organized under larger sections for easier access of information. If you are writing a document, and the section doesn’t yet exist, create the section. Each section should have its own folder under docs/source and include a landing page (named index.rst) for the overall section which includes general information, key links, and a toctree directive. This directive should include all the files in the section. Finally, the index file for the section should be added to the main Onboarding and Collaboration page.

Note

This document overview also acts as a reference file for restructured text. You can use it as an example for some of the basic formatting tools in RST.