Generating documentation for the server

Generating the server documentation involves a few more steps.

You need to follow the same preparatory steps as you did to generate this document. That is installing make and installing the server.

Run the following:

cd server/
mkdir docs
cd docs/
sphinx-quickstart

You will be asked a few questions about how to configure Sphinx. Just press enter on all, which will use the default. You can enter the correct project name and/or author if you want, but it’s not necessary, no one but you will see it anyway.

Then will need to modify a few files. First add the following code snippet after the first block of comments, above the “project information” comment, in the file ./server/docs/conf.py:

import os
import sys

basepath = os.path.dirname(__file__)
filepath = os.path.abspath(os.path.join(basepath, "../"))
sys.path.insert(0, filepath)

Then in the same file add an extension to the list of extensions, like so:

extensions = ["sphinx.ext.autodoc"]

Then just write the word app on line 13 in the file server/docs/index.rst. The file will then look something like:

.. toctree::
   :maxdepth: 2
   :caption: Contents:

   app

Then the documentation can be generated by running (still in the docs/ folder):

sphinx-apidoc -o ./ ../app --no-toc -f --separate --module-first
make html

You can then open it by typing:

start ./_build/html/index.html

You could add all of the files we just added, except _build/, to Git if you want.