-
Notifications
You must be signed in to change notification settings - Fork 37
Guide for Writing Documentation
AiiDA-Tutorial uses Sphinx to create the documentation. See:
- a great
introduction to ReStructured Text (RST) <http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>
_ - the official
Sphinx documentation <http://sphinx-doc.org>
_
- The Documentation System
- Google developer documentation style guide – especially the notes about tone.
- The Documentation Compendium
When writing documentation for sphinx in the reStructuredText Markup, authors should adhere to the following guidelines:
-
Write one sentence per line and otherwise no manual line wrapping to make easy to create and review diffs. All standard editors allow for dynamic line wrapping, and the line length is irrelevant for the rendered documentation in, e.g., HTML or PDF format.
-
File and directory names should be alphanumeric and all lower-case with underscores as word-separators. Example:
entry_points.rst
-
Headers must be set in sentence-case. Example: "Entry points"
-
Under-/overline section headers (not exceeding the header length), followed by an empty line. We suggest the following convention (adapted from here):
-
#
with overline for the global title -
*
with overline for chapters -
=
for sections -
-
for subsections -
^
for subsubsections
-
-
Separate paragraphs by one empty line, but not more.
-
Use the
*
symbol for itemized lists. -
Use the code-block directive (
.. code-block::
) instead of a double colon to markup code segments (see also section "Code Segments" below).
For more guidance see the Python style guide for RestructuredText.
- Bash shell scripts should use
bash
.. code-block:: bash verdi node show 1
- Bash shell sessions (i.e. interactive) should use
console
.. code-block:: console $ verdi node show 1
Use #
instead of $
to indicate a root prompt.
- Python scripts should use
python
.. code-block:: python from aiida import orm
- Python sessions (i.e. via
verdi shell
) should useipython
.. code-block:: ipython In [1]: print("a") Out [1]: "a"
-
Modify relevant doc strings or
.rst
files in the/docs/source/
folder (not in/docs/build
) -
Add new
.rst
files to the relevantindex.rst
files (table of contents) -
Run
make html
in the/docs
folder -
Open
build/html/index.html
to check the result -
| Fix warnings, if any.
Note: The continuous integration tests on your PR will fail, if warnings are encountered while building the documentation.
Please add target links to all top/sub-level headings in the following format, e.g.,
.. _how-to:installation:backup:restore:
To reference them further in the text, write
:ref:`how-to:installation:backup:restore`
- setup: one word, not "set up", e.g., "How to setup a computer."
- Python: Capitalized, not "python", because this is a name.
- UUID: Block capitalized.
- User: Someone who uses the AiiDA top-level API.
- Plugin developer: Someone who develops AiiDA plugins.
- Core developer: Someone who contributes to the AiiDA core package.