diff options
Diffstat (limited to 'doc/source/conf.py')
-rw-r--r-- | doc/source/conf.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py index 835ad9064..d08f29e59 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -2,6 +2,7 @@ import os import re import sys +import importlib # Minimum version, enforced by sphinx needs_sphinx = '3.2.0' @@ -84,9 +85,18 @@ extensions = [ 'IPython.sphinxext.ipython_console_highlighting', 'IPython.sphinxext.ipython_directive', 'sphinx.ext.mathjax', - 'breathe' ] +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'] |