blob: 153cfd02e1f8b2618bd5dd98d1d6d2926333a843 [file] [log] [blame]
Zack Williams7f708f82020-07-07 12:18:20 -07001Documentation Guide
2===================
3
4Writing Documentation
5---------------------
6
7Docs are generated using `Sphinx <https://www.sphinx-doc.org/en/master/>`_.
8
9Documentation is written in `reStructuredText
10<https://www.sphinx-doc.org/en/master/usage/restructuredtext/>`_.
11
12In reStructuredText documents, to create the section hierarchy (mapped in HTML
13to ``<h1>`` through ``<h5>``) use these characters to underline headings in the
14order given: ``=``, ``-`` ``"``, ``'``, ``^``.
15
16Building the Docs
17------------------
18
19The documentation build process is stored in the ``Makefile``. Building docs
20requires Python to be installed, and most steps will create a virtualenv
21(``venv_docs``) which contains the required tools. You may also need to
22install the ``enchant`` C library using your system's package manager for the
23spelling checker to function properly.
24
25Run ``make html`` to generate html documentation in ``_build/html``.
26
27To check the formatting of documentation, run ``make lint``. This will be done
28in Jenkins to validate the documentation, so please do this before you create a
29patchset.
30
31To check spelling, run ``make spelling``. If there are additional words that
32are correctly spelled but not in the dictionary (acronyms, trademarks, etc.)
33please add them to the ``dict.txt`` file.
34
35Creating new Versions of Docs
36-----------------------------
37
38To change the version shown on the built site, change the contents of the
39``VERSION`` file.
40
41There is a ``make multiversion`` target which will build all versions published
42on the remote to ``_build``. This will use a fork of `sphinx-multiversion
43<https://github.com/Holzhaus/sphinx-multiversion>`_ to build multiple versions
44for the site.
45
46Creating Graphs and Diagrams
47----------------------------
48
49Multiple tools are available to render inline text-based graphs definitions and
50diagrams within the documentation. This is preferred over images as it's easier
51to change and see changes over time as a diff.
52
53`Graphviz
54<https://www.sphinx-doc.org/en/master/usage/extensions/graphviz.html>`_
55supports many standard graph types.
56
57The `blockdiag <http://blockdiag.com/en/blockdiag/sphinxcontrib.html>`_,
58`nwdiag, and rackdiag <http://blockdiag.com/en/nwdiag/sphinxcontrib.html>`_,
59and `seqdiag <http://blockdiag.com/en/seqdiag/sphinxcontrib.html>`_ suites of
60tools can be used to create specific types of diagrams:
61
62- `blockdiag examples <http://blockdiag.com/en/blockdiag/examples.html>`_
63- `nwdiag examples <http://blockdiag.com/en/nwdiag/nwdiag-examples.html>`_
64- `rackdiag examples <http://blockdiag.com/en/nwdiag/rackdiag-examples.html>`_
65- `seqdiag examples <http://blockdiag.com/en/seqdiag/examples.html>`_
66
67The styles applied to nodes and connections in these diagrams can be customized
68using `attributes
69<http://blockdiag.com/en/blockdiag/attributes/node.attributes.html>`_.