summaryrefslogtreecommitdiff
path: root/ext/pybind11/docs/conf.py
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pybind11/docs/conf.py')
-rw-r--r--ext/pybind11/docs/conf.py34
1 files changed, 29 insertions, 5 deletions
diff --git a/ext/pybind11/docs/conf.py b/ext/pybind11/docs/conf.py
index 69f0cb337..09604cfeb 100644
--- a/ext/pybind11/docs/conf.py
+++ b/ext/pybind11/docs/conf.py
@@ -16,6 +16,7 @@
import sys
import os
import shlex
+import subprocess
# 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
@@ -30,7 +31,11 @@ import shlex
# 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']
+
+breathe_projects = {'pybind11': '.build/doxygenxml/'}
+breathe_default_project = 'pybind11'
+breathe_domain_by_extension = {'h': 'cpp'}
# Add any paths that contain templates here, relative to this directory.
templates_path = ['.templates']
@@ -48,7 +53,7 @@ master_doc = 'index'
# General information about the project.
project = 'pybind11'
-copyright = '2015, Wenzel Jakob'
+copyright = '2016, Wenzel Jakob'
author = 'Wenzel Jakob'
# The version info for the project you're documenting, acts as replacement for
@@ -56,9 +61,9 @@ author = 'Wenzel Jakob'
# built documents.
#
# The short X.Y version.
-version = '1.9'
+version = '2.1'
# The full version, including alpha/beta/rc tags.
-release = '1.9.dev0'
+release = '2.1.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -79,7 +84,7 @@ exclude_patterns = ['.build', 'release.rst']
# The reST default role (used for this markup: `text`) to use for all
# documents.
-#default_role = None
+default_role = 'any'
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
@@ -306,3 +311,22 @@ texinfo_documents = [
primary_domain = 'cpp'
highlight_language = 'cpp'
+
+
+def generate_doxygen_xml(app):
+ build_dir = '.build'
+ if not os.path.exists(build_dir):
+ os.mkdir(build_dir)
+
+ try:
+ subprocess.call(['doxygen', '--version'])
+ retcode = subprocess.call(['doxygen'])
+ if retcode < 0:
+ sys.stderr.write("doxygen error code: {}\n".format(-retcode))
+ except OSError as e:
+ sys.stderr.write("doxygen execution failed: {}\n".format(e))
+
+
+def setup(app):
+ """Add hook for building doxygen xml when needed"""
+ app.connect("builder-inited", generate_doxygen_xml)