Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Sphinx 1.6 deprecate html4 #1091

Merged
merged 1 commit into from Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/installing.rst
Expand Up @@ -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 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -117,7 +117,7 @@ def run(self):
]
},
install_requires=[
'sphinx'
'sphinx>=1.6'
],
tests_require=[
'pytest',
Expand Down
20 changes: 11 additions & 9 deletions sphinx_rtd_theme/__init__.py
Expand Up @@ -8,12 +8,7 @@

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
from sphinx.util.logging import getLogger


__version__ = '0.5.1'
Expand All @@ -38,9 +33,16 @@ 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):
# Register the theme that can be referenced without adding a theme path
app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__)))
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__)))

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