Skip to content

Commit 90a4e75

Browse files
authored
Merge pull request kivy#7766 from kivy/fix/sphinx-lexer-multiple-versions
Add support for older Sphinx versions
2 parents c02d716 + 54c6f29 commit 90a4e75

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/sources/sphinxext/preprocess.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import types
77
import sys
88
from os.path import dirname, join
9+
import sphinx
910
from sphinx.ext.autodoc import MethodDocumenter
1011

1112
class CythonMethodDocumenter(MethodDocumenter):
@@ -109,7 +110,10 @@ def setup(app):
109110
sys.path += [join(dirname(kivy.__file__), 'extras')]
110111
from highlight import KivyLexer
111112

112-
app.add_lexer('kv', KivyLexer)
113+
if sphinx.version_info[0] >= 3:
114+
app.add_lexer('kv', KivyLexer)
115+
else:
116+
app.add_lexer('kv', KivyLexer())
113117
app.add_autodocumenter(CythonMethodDocumenter)
114118
app.connect('autodoc-process-docstring', callback_docstring)
115119
app.connect('autodoc-process-signature', callback_signature)

0 commit comments

Comments
 (0)