Using the Sphinx documentation program
Sphinx was written for Python documentation and is used extensively in official document creation. As a matter of fact, all of the documentation on the Python site is generated by Sphinx. Even the Sphinx website is written in reST and converted to HTML.
Sphinx can convert reST into HTML, PDF, ePub, Texinfo, and man pages. The program is also extensible, for example, via plugins, to generate mathematical notations from formulas or highlight source code.
Getting ready
Download Sphinx via pip
or system installation, such as with apt install
.
How to do it...
- Once installed, it is suggested you move to the project directory, as the program defaults to looking for files in the current directory. This is not required, however, as you can always change the configuration later.
- Run the following command at the command prompt:
sphinx-quickstart
. You will walk through an interactive configuration session, as follows:
- The questions are generally self-explanatory, but...