blob: 37dce1514e3ba8e033db501bdcad3078096f9d16 [file] [log] [blame]
Zack Williams071eda22019-05-15 18:19:51 -07001Documentation Guide
2===================
3
Zack Williams16042b62020-03-29 22:03:16 -07004Writing Documentation
5---------------------
6
7Docs are generated using `Sphinx <https://www.sphinx-doc.org/en/master/>`_.
8
9Documentation can be written in `reStructuredText
10<https://www.sphinx-doc.org/en/master/usage/restructuredtext/>`_ (``.rst``) or
11`Markdown <https://daringfireball.net/projects/markdown/>`_ (``.md``), but
12reStructuredText is preferred as that filetype supports features like embedded
13diagrams and tables.
14
15In reStructuredText documents, to create the section hierarchy (mapped in HTML
16to ``<h1>`` through ``<h5>``) use these characters to underline headings in the
17order given: ``=``, ``-`` ``"``, ``'``, ``^``.
18
Zack Williams071eda22019-05-15 18:19:51 -070019Building the Docs
20------------------
21
Zack Williams16042b62020-03-29 22:03:16 -070022The documentation build process is stored in the ``Makefile``. Building docs
Zack Williams071eda22019-05-15 18:19:51 -070023requires Python to be installed, and most steps will create a virtualenv
Zack Williams16042b62020-03-29 22:03:16 -070024(``venv_docs``) which contains the required tools. You may also need to
25install the ``enchant`` C library using your system's package manager for the
26spelling checker to function properly.
Zack Williams071eda22019-05-15 18:19:51 -070027
28Run ``make html`` to generate html documentation in ``_build/html``.
29
Zack Williams071eda22019-05-15 18:19:51 -070030To check the formatting of documentation, run ``make lint``. This will be done
31in Jenkins to validate the documentation, so please do this before you create a
32patchset.
33
Zack Williamsc6460c22019-12-18 14:54:43 -070034To check spelling, run ``make spelling``. If there are additional words that
35are correctly spelled but not in the dictionary (acronyms, trademarks, etc.)
36please add them to the ``dict.txt`` file.
37
Zack Williams88df4742019-12-20 08:24:47 -070038Creating new Versions of Docs
39-----------------------------
40
Zack Williams16042b62020-03-29 22:03:16 -070041To change the version shown on the built site, change the contents of the
42``VERSION`` file.
Zack Williams88df4742019-12-20 08:24:47 -070043
Zack Williams16042b62020-03-29 22:03:16 -070044There is a ``make multiversion`` target which will build all versions published
45on the remote to ``_build``. This will use a fork of `sphinx-multiversion
46<https://github.com/Holzhaus/sphinx-multiversion>`_ to build multiple versions
47for the site.
Zack Williams88df4742019-12-20 08:24:47 -070048
Zack Williams16042b62020-03-29 22:03:16 -070049Creating Graphs and Diagrams
50----------------------------
Zack Williams071eda22019-05-15 18:19:51 -070051
Zack Williams16042b62020-03-29 22:03:16 -070052Multiple tools are available to render inline text-based graphs definitions and
53diagrams within the documentation. This is preferred over images as it's easier
54to change and see changes over time as a diff.
Zack Williams071eda22019-05-15 18:19:51 -070055
Zack Williams16042b62020-03-29 22:03:16 -070056`Graphviz
57<https://www.sphinx-doc.org/en/master/usage/extensions/graphviz.html>`_
58supports many standard graph types.