]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
docs-rst: enable the Sphinx math extension
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 16 Aug 2016 16:25:43 +0000 (13:25 -0300)
committerJonathan Corbet <corbet@lwn.net>
Thu, 18 Aug 2016 22:42:33 +0000 (16:42 -0600)
This extension will be used by the media books.

The name of the math image extension changed on Sphinx 1.4.x,
according with:
http://www.sphinx-doc.org/en/stable/ext/math.html#module-sphinx.ext.imgmath

Let's autodetect, to keep building with versions < 1.4.

Suggested-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/conf.py

index 61b71ae60ad07a226f75b50deb08bec8d32de35d..23e2f0bbcfc88052325e118d9490750cc67b529d 100644 (file)
 
 import sys
 import os
+import sphinx
+
+# Get Sphinx version
+major, minor, patch = map(int, sphinx.__version__.split("."))
+
 
 # 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
@@ -31,6 +36,12 @@ from load_config import loadConfig
 # ones.
 extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include']
 
+# The name of the math extension changed on Sphinx 1.4
+if minor > 3:
+    extensions.append("sphinx.ext.imgmath")
+else:
+    extensions.append("sphinx.ext.pngmath")
+
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']