From 80a078a505224fec4f7f913d9479cb78e79d2992 Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Mon, 18 Mar 2019 15:33:31 +0100 Subject: [PATCH] Compatibility fix for sphinx documentation --- doc/en/conf.py | 10 +++++++--- doc/fr/conf.py | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index d1c9d94..b1d0cb0 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -34,7 +34,7 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import sys, os, sphinx # 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 @@ -57,8 +57,12 @@ except: # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ["sphinx.ext.imgmath"] -# extensions = ["sphinx.ext.pngmath"] +from distutils.version import LooseVersion #, StrictVersion +if LooseVersion(sphinx.__version__) < LooseVersion("1.4.0"): + extensions = ["sphinx.ext.pngmath"] +else: + extensions = ["sphinx.ext.imgmath"] +# # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/doc/fr/conf.py b/doc/fr/conf.py index 2f76da9..7fa242a 100644 --- a/doc/fr/conf.py +++ b/doc/fr/conf.py @@ -34,7 +34,7 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import sys, os, sphinx # 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 @@ -57,8 +57,12 @@ except: # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ["sphinx.ext.imgmath"] -# extensions = ["sphinx.ext.pngmath"] +from distutils.version import LooseVersion #, StrictVersion +if LooseVersion(sphinx.__version__) < LooseVersion("1.4.0"): + extensions = ["sphinx.ext.pngmath"] +else: + extensions = ["sphinx.ext.imgmath"] +# # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] -- 2.39.2