Sphinx is a Python-based documentation system that allows writing documentation in a simple mark-up language called ReStructuredText, which can then be converted to html or to latex files (and then to pdf or postscript). See [sphinx] for general information, [sphinx-documentation] for a complete manual, and [sphinx-rst] or [rst-documentation] for a primer on ReStructuredText. See also [sphinx-cheatsheet].
Although originally designed for aiding in documentation of Python software, it is now being used for documentation of packages in other languages as well. See [sphinx-examples] for a list of other projects that use Sphinx.
It can also be used for things beyond software documentation. In particular, it has been used to create the class note webpages that you are now reading. It was chosen for two main reasons:
The easiest way to learn how to create Sphinx pages is to read some of the documentation and then examine Sphinx pages such as the one you are now reading to see how it is written. You can do this with these class notes or you might look at one of the other [sphinx-examples] to see other styles.
Note that any time you are reading a page of these class notes (or other things created with Sphinx) there is generally a menu item Show Source and clicking on this link shows the raw text file as originally written. (This is not true of the Coursera version of these notes.)
It is possible to customize Sphinx so the pages look very different, as you’ll see if you visit some other projects listed at [sphinx-examples].
If you want to create your own set of Sphinx pages for some project, it is easy to get started following the instructions at [sphinx], or for a quick start with a different look and feel, see [sphinx-sampledoc].
If you clone the git repository for this class (see Git), you will find a subdirectory called notes, containing a number of files with the extension .rst, one for each webpage, containing the ReStructuredText input.
Make sure you have done:
$ git checkout coursera
first in the repository (i.e. from within the $UWHPSC directory or any subdirectory such as $UWHPSC/notes) so that you see the Coursera version of the class notes.
To create the html pages, first make sure you have Sphinx installed via:
$ which sphinx-build
(see Downloading and installing software for this class) and then type:
$ make html
This should process all the files (see Makefiles) and create a subdirectory of notes called _build/html. The file _build/html/index.html contains the main Table of Contents page. Navigate your browser to this page using Open File on the File menu of your browser.
Or you may be able to direct Firefox directly to this page via:
$ firefox _build/html/index.html
If you type:
$ make latex
then Sphinx will create a subdirectory _build/latex containing latex files. If you have latex installed, you can then do:
$ cd _build/latex
$ make all-pdf
to run latex and create a pdf version of all the class notes.
See [sphinx] for general information, [sphinx-documentation] for a complete manual, and [sphinx-rst] or [rst-documentation]. See also [sphinx-cheatsheet].
See [sphinx-sampledoc] to get started on your own project.