diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-08-16 12:25:43 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2016-08-18 18:42:33 -0400 |
commit | d4fe7e14e4ff5d90286397180831a35df502969e (patch) | |
tree | 8c1194a455c33fe2e70096e01f61fadf5a29c9b9 /Documentation/conf.py | |
parent | 8b8bbf8fe5cfd9aada5f29dc6f6e5b8e4320d058 (diff) |
docs-rst: enable the Sphinx math extension
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>
Diffstat (limited to 'Documentation/conf.py')
-rw-r--r-- | Documentation/conf.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Documentation/conf.py b/Documentation/conf.py index 61b71ae60ad0..23e2f0bbcfc8 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py | |||
@@ -14,6 +14,11 @@ | |||
14 | 14 | ||
15 | import sys | 15 | import sys |
16 | import os | 16 | import os |
17 | import sphinx | ||
18 | |||
19 | # Get Sphinx version | ||
20 | major, minor, patch = map(int, sphinx.__version__.split(".")) | ||
21 | |||
17 | 22 | ||
18 | # If extensions (or modules to document with autodoc) are in another directory, | 23 | # If extensions (or modules to document with autodoc) are in another directory, |
19 | # add these directories to sys.path here. If the directory is relative to the | 24 | # add these directories to sys.path here. If the directory is relative to the |
@@ -31,6 +36,12 @@ from load_config import loadConfig | |||
31 | # ones. | 36 | # ones. |
32 | extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include'] | 37 | extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include'] |
33 | 38 | ||
39 | # The name of the math extension changed on Sphinx 1.4 | ||
40 | if minor > 3: | ||
41 | extensions.append("sphinx.ext.imgmath") | ||
42 | else: | ||
43 | extensions.append("sphinx.ext.pngmath") | ||
44 | |||
34 | # Add any paths that contain templates here, relative to this directory. | 45 | # Add any paths that contain templates here, relative to this directory. |
35 | templates_path = ['_templates'] | 46 | templates_path = ['_templates'] |
36 | 47 | ||