From 7c5eef1097425cfbcccb4745e7915fa3e547cd6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Fri, 28 Apr 2017 22:16:52 +0200 Subject: doc: add sphinx breathe extension --- doc/conf.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/conf.py b/doc/conf.py index 087b260..69ab8d3 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -16,10 +16,21 @@ # 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. # -# import os -# import sys +import os +import sys +import subprocess # sys.path.insert(0, os.path.abspath('.')) +# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + +print subprocess.check_output('mkdir -p build/doxygen && doxygen', shell=True) + +breathe_projects = { + 'vis': 'build/doxygen/xml' +} + +breathe_default_project = "vis" # -- General configuration ------------------------------------------------ @@ -30,7 +41,7 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [] +extensions = ['breathe'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -152,5 +163,10 @@ texinfo_documents = [ 'Miscellaneous'), ] +if not on_rtd: # only import and set the theme if we're building docs locally + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +# otherwise, readthedocs.org uses their theme by default, so no need to specify it -- cgit v1.2.3