Skip to content

Commit 114fb85

Browse files
authored
Require Sphinx 1.6 deprecate html4 (#1091)
Sphinx 1.6 is required for de76c03 we also do not test against versions lower than 1.6 so we should safely drop it. This is similar to #1076 and #1075 but less strict
1 parent 68d4b8a commit 114fb85

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

docs/installing.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,11 @@ Symlink or subtree the ``sphinx_rtd_theme/sphinx_rtd_theme`` repository into you
4545
4646
html_theme = "sphinx_rtd_theme"
4747
html_theme_path = ["_themes", ]
48+
49+
Compatibility
50+
=============
51+
52+
``sphinx_rtd_theme`` depends on at least Sphinx 1.6 although,
53+
we recommend at least Sphinx 2 to take advantage of the html5 writer.
54+
The html4 writer is still supported however,
55+
it is deprecated and support will be removed in the near future.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def run(self):
117117
]
118118
},
119119
install_requires=[
120-
'sphinx'
120+
'sphinx>=1.6'
121121
],
122122
tests_require=[
123123
'pytest',

sphinx_rtd_theme/__init__.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@
88

99
from sphinx import version_info
1010
from sphinx.locale import _
11-
12-
try:
13-
# Avaliable from Sphinx 1.6
14-
from sphinx.util.logging import getLogger
15-
except ImportError:
16-
from logging import getLogger
11+
from sphinx.util.logging import getLogger
1712

1813

1914
__version__ = '0.5.1'
@@ -38,9 +33,16 @@ def config_initiated(app, config):
3833

3934
# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
4035
def setup(app):
41-
if version_info >= (1, 6, 0):
42-
# Register the theme that can be referenced without adding a theme path
43-
app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__)))
36+
app.require_sphinx('1.6')
37+
if version_info <= (2, 0, 0):
38+
if not app.config.html_experimental_html5_writer:
39+
logger.warning("'html4_writer' is deprecated with sphinx_rtd_theme")
40+
else:
41+
if app.config.html4_writer:
42+
logger.warning("'html4_writer' is deprecated with sphinx_rtd_theme")
43+
44+
# Register the theme that can be referenced without adding a theme path
45+
app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__)))
4446

4547
if version_info >= (1, 8, 0):
4648
# Add Sphinx message catalog for newer versions of Sphinx

0 commit comments

Comments
 (0)