5.4. Creating new documentation with Sphinx
This section describes how sphinx documentation can be created for your project. Typically this documentation would be generated within a code repository.
Setting up a Sphinx project
Follow the quick-start instructions on the official sphinx documentation page
During this process, it will ask
Separate source and build directories (y/n). Select yes.You can now add new reST source files and place them in the
docs/sourcefolder.Add the filenames of these new source file to the
index.rstfile in thedocs/sourcefolder.
To make this process easier, we have provided a template software project on Github that you can use to get started. Download and copy the docs folder from this repository
Building Sphinx documentation
From the command line
In a terminal, change directory to the folder where the sphinx documentation was generated (ie the
docsfolder):
cd path/to/docs
Enter the following command.
make html
You can then open the html version of the documentation by opening
/path/to/docs/build/index.htmlin your browser of choice e.g. Google Chrome.
From IDEs
For more information on how to build documentation from IDEs such as PyCharm, see the Updating documentation Section of this tutorial.