Getting Started

See also

Part of the following information is reproduced from Read the Docs Getting Started with Sphinx

Sphinx is a powerful documentation generator that has many great features for writing technical documentation including:

  • Generate web pages, printable PDFs, documents for e-readers (ePub), and more all from the same sources

  • You can use reStructuredText or Markdown to write documentation

  • An extensive system of cross-referencing code and documentation

  • Syntax highlighted code samples

  • A vibrant ecosystem of first and third-party extensions

If you want to learn more about how to create your first Sphinx project, read on.

Quick start

Assuming you have Python already:

$ pip install sphinx

Create a directory inside your project to hold your docs:

$ cd /path/to/project
$ mkdir docs

Run sphinx-quickstart in there:

$ cd docs
$ sphinx-quickstart

This quick start will walk you through creating the basic configuration; in most cases, you can just accept the defaults. When it’s done, you’ll have an index.rst, a conf.py and some other files. Add these to revision control.

Now, edit your index.rst and add some information about your project. Include as much detail as you like. Build them to see how they look:

$ make html

Your index.rst has been built into index.html in your documentation output directory (typically _build/html/index.html). Open this file in your web browser to see your docs.

Building this documentation

To access this documentation offline, install the following python packages. We recommend using a python virtual environment (i.e., venv).

$ pip install sphinx
$ pip install sphinx-prompt
$ pip install sphinx-rtd-theme

Clone the CYAN Lab documentation repository in your project directory to hold your docs:

$ cd /path/to/project
$ git clone https://github.com/purduecyan/rtfm
$ cd rtfm
$ make html

The documentation will be built into your build/html/ directory. Open the index.html file in your web browser to see your docs.

Updating Git Submodules

To update all git submodule repositories in the source folder:

$ cd source
$ git submodule update --remote

Next, add, commit and push the files to remote for changes to take effect.

External resources

Here are some external resources to help you learn more about Sphinx.