mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2025-02-25 18:55:21 -06:00
Require Sphinx 1.6 deprecate html4 (#1091)
Sphinx 1.6 is required for de76c03824
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
This commit is contained in:
parent
68d4b8aac7
commit
114fb85b44
@ -45,3 +45,11 @@ Symlink or subtree the ``sphinx_rtd_theme/sphinx_rtd_theme`` repository into you
|
||||
|
||||
html_theme = "sphinx_rtd_theme"
|
||||
html_theme_path = ["_themes", ]
|
||||
|
||||
Compatibility
|
||||
=============
|
||||
|
||||
``sphinx_rtd_theme`` depends on at least Sphinx 1.6 although,
|
||||
we recommend at least Sphinx 2 to take advantage of the html5 writer.
|
||||
The html4 writer is still supported however,
|
||||
it is deprecated and support will be removed in the near future.
|
||||
|
2
setup.py
2
setup.py
@ -117,7 +117,7 @@ setup(
|
||||
]
|
||||
},
|
||||
install_requires=[
|
||||
'sphinx'
|
||||
'sphinx>=1.6'
|
||||
],
|
||||
tests_require=[
|
||||
'pytest',
|
||||
|
@ -8,12 +8,7 @@ from os import path
|
||||
|
||||
from sphinx import version_info
|
||||
from sphinx.locale import _
|
||||
|
||||
try:
|
||||
# Avaliable from Sphinx 1.6
|
||||
from sphinx.util.logging import getLogger
|
||||
except ImportError:
|
||||
from logging import getLogger
|
||||
|
||||
|
||||
__version__ = '0.5.1'
|
||||
@ -38,7 +33,14 @@ def config_initiated(app, config):
|
||||
|
||||
# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
|
||||
def setup(app):
|
||||
if version_info >= (1, 6, 0):
|
||||
app.require_sphinx('1.6')
|
||||
if version_info <= (2, 0, 0):
|
||||
if not app.config.html_experimental_html5_writer:
|
||||
logger.warning("'html4_writer' is deprecated with sphinx_rtd_theme")
|
||||
else:
|
||||
if app.config.html4_writer:
|
||||
logger.warning("'html4_writer' is deprecated with sphinx_rtd_theme")
|
||||
|
||||
# Register the theme that can be referenced without adding a theme path
|
||||
app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__)))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user