summaryrefslogtreecommitdiff
path: root/doc/source/conf.py
diff options
context:
space:
mode:
Diffstat (limited to 'doc/source/conf.py')
-rw-r--r--doc/source/conf.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 41b5cee25..a7a885c34 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -1,7 +1,7 @@
-# -*- coding: utf-8 -*-
import os
import re
import sys
+import importlib
# Minimum version, enforced by sphinx
needs_sphinx = '3.2.0'
@@ -86,6 +86,16 @@ extensions = [
'sphinx.ext.mathjax',
]
+skippable_extensions = [
+ ('breathe', 'skip generating C/C++ API from comment blocks.'),
+]
+for ext, warn in skippable_extensions:
+ ext_exist = importlib.util.find_spec(ext) is not None
+ if ext_exist:
+ extensions.append(ext)
+ else:
+ print(f"Unable to find Sphinx extension '{ext}', {warn}.")
+
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -477,3 +487,11 @@ class NumPyLexer(CLexer):
inherit,
],
}
+
+
+# -----------------------------------------------------------------------------
+# Breathe & Doxygen
+# -----------------------------------------------------------------------------
+breathe_projects = dict(numpy=os.path.join("..", "build", "doxygen", "xml"))
+breathe_default_project = "numpy"
+breathe_default_members = ("members", "undoc-members", "protected-members")