Commit 87b2b1eb authored by Steven Cordwell's avatar Steven Cordwell
Browse files

Add Sphinx settings suitable for

parent ea2cf20f
......@@ -155,7 +155,8 @@ optimal policy.
Documentation is available as docstrings in the module code.
Documentation is available at
and also as docstrings in the module code.
If you use `IPython <>`_ to work with the toolbox,
then you can view the docstrings by using a question mark ``?``. For example:
......@@ -167,10 +168,6 @@ then you can view the docstrings by using a question mark ``?``. For example:
will display the relevant documentation.
Once the Sphinx document geneator has been set up correctly then the
documentation will be available at
.. TODO and as html in the doc folder.
......@@ -17,6 +17,24 @@ import sys
import os
import shlex
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
# When on read the docs stub out the modules that cannot be loaded
if on_rtd:
from unittest.mock import MagicMock
except ImportError:
from mock import MagicMock
class Mock(MagicMock):
def __getattr__(cls, name):
return Mock()
MOCK_MODULES = ['numpy', 'scipy', 'scipy.sparse', 'cvxopt']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
......@@ -31,14 +49,24 @@ sys.path.insert(0, os.path.abspath('../src'))
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
if on_rtd:
# Napoleon settings
napoleon_google_docstrings = False
napoleon_use_param = True
......@@ -120,7 +148,7 @@ todo_include_todos = False
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'alabaster'
html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment