Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 1 | Documentation Guide |
| 2 | =================== |
| 3 | |
| 4 | Building the Docs |
| 5 | ------------------ |
| 6 | |
| 7 | The documentation build process is stored in the Makefile. Building docs |
| 8 | requires Python to be installed, and most steps will create a virtualenv |
| 9 | (``doc_venv``) which install the documentation generation toolset. |
| 10 | |
| 11 | Run ``make html`` to generate html documentation in ``_build/html``. |
| 12 | |
| 13 | Run ``make reload`` to get a live reload in your browser (refreshes on document |
| 14 | save). |
| 15 | |
| 16 | To check the formatting of documentation, run ``make lint``. This will be done |
| 17 | in Jenkins to validate the documentation, so please do this before you create a |
| 18 | patchset. |
| 19 | |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 20 | To check spelling, run ``make spelling``. If there are additional words that |
| 21 | are correctly spelled but not in the dictionary (acronyms, trademarks, etc.) |
| 22 | please add them to the ``dict.txt`` file. |
| 23 | |
Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 24 | Writing Docs |
| 25 | ------------ |
| 26 | |
| 27 | Docs written using sphinx: http://www.sphinx-doc.org |
| 28 | |
| 29 | Documentation is done in reStructuredText (``.rst``) or Markdown (``.md``), |
| 30 | but only .rst files can use certain features like embedded diagrams. |
| 31 | |
| 32 | reStructuredText Primer: |
| 33 | http://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html |
| 34 | |
Zack Williams | 88df474 | 2019-12-20 08:24:47 -0700 | [diff] [blame] | 35 | Creating new Versions of Docs |
| 36 | ----------------------------- |
| 37 | |
| 38 | To change the version shown on the built site, change the ``versions`` variable in ``conf.py``. |
| 39 | |
| 40 | There is a ``make versioned`` target which will build all versions published on |
| 41 | the remote to ``_build``. Note that we're using a fork of the upstream version |
Zack Williams | e377eae | 2019-12-20 16:40:38 -0700 | [diff] [blame] | 42 | of the ``sphinxcontrib-versioning`` module, as the original isn't actively |
| 43 | maintained, and we needed it to be able to handle the symlink checkouts of |
Zack Williams | 88df474 | 2019-12-20 08:24:47 -0700 | [diff] [blame] | 44 | other repos that are incorporated. |
| 45 | |
Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 46 | Creating Diagrams |
| 47 | ----------------- |
| 48 | |
| 49 | Inline Graphviz is supported: |
| 50 | https://www.sphinx-doc.org/en/master/usage/extensions/graphviz.html |
| 51 | |
| 52 | The blockdiag suite of tools can be used for other specific graph types: |
| 53 | |
| 54 | - Block diagrams: http://blockdiag.com/en/blockdiag/sphinxcontrib.html |
| 55 | - Network diagrams (& racks): http://blockdiag.com/en/nwdiag/sphinxcontrib.html |
| 56 | |
| 57 | Attributes that can be applied to nodes: |
| 58 | http://blockdiag.com/en/blockdiag/attributes/node.attributes.html |
| 59 | |
| 60 | Examples: |
| 61 | |
| 62 | - blockdiag: http://blockdiag.com/en/blockdiag/examples.html |
| 63 | - nwdiag: http://blockdiag.com/en/nwdiag/nwdiag-examples.html |
| 64 | - rackdiag: http://blockdiag.com/en/nwdiag/rackdiag-examples.html |