| 1 |
.. _documentation: |
| 2 |
|
| 3 |
Documentation |
| 4 |
============= |
| 5 |
|
| 6 |
This section documents how to update and build the documentation |
| 7 |
|
| 8 |
Continuous Documentation |
| 9 |
------------------------ |
| 10 |
|
| 11 |
The BusKill project treats documentation-as-code. It is versioned, managed with ``git``, and automatically built and released with our `CI/CD GitHub Actions workflows <https://github.com/BusKill/buskill-app/blob/master/.github/workflows/docs_pages_workflow.yml>`_. |
| 12 |
|
| 13 |
Our documentation is written in `reStructuredText (reST) <https://en.wikipedia.org/wiki/ReStructuredText>`_ and built using `sphinx <https://www.sphinx-doc.org/en/master/>`_ with the `Read The Docs theme <https://github.com/readthedocs/sphinx_rtd_theme>`_. This has the following benefits: |
| 14 |
|
| 15 |
#. reST is human-readable plaintext. It plays nice with a VCS (like ``git``). |
| 16 |
|
| 17 |
a. Plaintext is easier to review for PRs, making malicious PRs easier to detect. |
| 18 |
b. It's not necessary to build in order to read. The cryptographically-signed git commit sources can be read directly. |
| 19 |
c. Our documentation gets versioned exactly matching our code's release branches. |
| 20 |
|
| 21 |
#. It's trivial for Sphinx to export to `multiple formats <https://www.sphinx-doc.org/en/master/usage/builders/index.html>`_, such as HTML, PDF, EPUB, etc. |
| 22 |
|
| 23 |
#. reST is much more powerful than other human-readable markups. |
| 24 |
|
| 25 |
a. We can define our own `extensions using python <https://www.sphinx-doc.org/en/master/development/tutorials/helloworld.html>`_ to do complex logic like `converting LibreOffice spreadsheets with calculations into tables <https://stackoverflow.com/questions/62682095/how-to-add-a-spreadsheet-in-read-the-docs>`_ |
| 26 |
|
| 27 |
#. Sphinx has built-in support for documenting python sourcecode using `autodoc <https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html>`_ |
| 28 |
|
| 29 |
Updating |
| 30 |
-------- |
| 31 |
|
| 32 |
If you'd like to update this documentation, you can `fork <https://docs.github.com/en/github/getting-started-with-github/fork-a-repo>`_ our `repo <https://github.com/buskill/buskill-app>`_, edit the files as-needed in the `docs directory <https://github.com/BusKill/buskill-app/tree/master/docs>`_, and `submit a PR <https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork>`_. |
| 33 |
|
| 34 |
To know which file to edit, click the ``Edit on GitHub`` link on the top-right of the page you wish to edit. |
| 35 |
|
| 36 |
.. _documentation_building: |
| 37 |
|
| 38 |
Building |
| 39 |
-------- |
| 40 |
|
| 41 |
You can build our documentation on Debian 10 using the following commands |
| 42 |
|
| 43 |
:: |
| 44 |
|
| 45 |
sudo apt-get update |
| 46 |
sudo apt-get -y install git firefox-esr python3-git python3-sphinx python3-sphinx-rtd-theme |
| 47 |
|
| 48 |
git clone https://github.com/BusKill/buskill-app.git |
| 49 |
cd buskill-app/docs |
| 50 |
|
| 51 |
make clean |
| 52 |
make html |
| 53 |
|
| 54 |
After executing the above commands, you should have a new ``docs/_build/html/`` directory. You can open your locally-built documentation in firefox by executing |
| 55 |
|
| 56 |
:: |
| 57 |
|
| 58 |
firefox-esr _build/html/index.html |