Generate Docs using Sphinx
Sphinx is a tool for creating documentation under the BSD license. Official Guideline: https://www.sphinx-doc.org/en/master/index.html.
- Install Sphinx
- Conda install
$ conda install -c anaconda sphinx
- Ubuntu
$ apt-get install python3-sphinx
2. Quick Start
The root directory of a Sphinx collection of reStructuredText document sources is called the source directory. This directory also contains the Sphinx configuration file conf.py, where you can configure all aspects of how Sphinx reads your sources and builds your documentation.( https://www.sphinx-doc.org/en/master/usage/quickstart.html)
- Script: sphinx-quickstart sets up a source directory and creates template files including a default conf.py. It also creates an empty build directory.
$ sphinx-quickstart
3. Running the Build
Two methods can be used to build the code and generate the documentations such as html files.
- Using the sphinx-build program
$ sphinx-build -b html sourcedir builddir
where sourcedir is the source directory, and builddir is the directory in which you want to place the built documentation. The -b option selects a builder, here building HTML files.
- Using Make
$ make html$ make pdf
if there are a Makefile and a make.bat which can be created by the sphinx-quickstart program.