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