blob: 6beac1dd18adb75e038e2e315f7f2cec9a1b1f6b [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.
Zack Williams071eda22019-05-15 18:19:51 -070059
Zack Williams16042b62020-03-29 22:03:16 -070060The `blockdiag <http://blockdiag.com/en/blockdiag/sphinxcontrib.html>`_,
61`nwdiag, and rackdiag <http://blockdiag.com/en/nwdiag/sphinxcontrib.html>`_,
62and `seqdiag <http://blockdiag.com/en/seqdiag/sphinxcontrib.html>`_ suites of
63tools can be used to create specific types of diagrams:
Zack Williams071eda22019-05-15 18:19:51 -070064
Zack Williams16042b62020-03-29 22:03:16 -070065- `blockdiag examples <http://blockdiag.com/en/blockdiag/examples.html>`_
66- `nwdiag examples <http://blockdiag.com/en/nwdiag/nwdiag-examples.html>`_
67- `rackdiag examples <http://blockdiag.com/en/nwdiag/rackdiag-examples.html>`_
68- `seqdiag examples <http://blockdiag.com/en/seqdiag/examples.html>`_
Zack Williams071eda22019-05-15 18:19:51 -070069
Zack Williams16042b62020-03-29 22:03:16 -070070The styles applied to nodes and connections in these diagrams can be customized
71using `attributes
72<http://blockdiag.com/en/blockdiag/attributes/node.attributes.html>`_.