From 59685c4c349c6b44136c8d7b8d28fd62c8057412 Mon Sep 17 00:00:00 2001 From: Trevor Bekolay Date: Sun, 18 Dec 2016 14:05:46 -0500 Subject: [PATCH] Use Sphinx.set_translator. This allows us to always register the `HTMLTranslator` instead of informing users to add the translator to their configuration files. The `html_translator_class` config option was recently deprecated, so now seems a good time to switch. --- README.rst | 4 ---- demo/conf.py | 1 - guzzle_sphinx_theme/__init__.py | 1 + requirements.txt | 2 +- setup.py | 2 +- 5 files changed, 3 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index ed11a7b..8c46552 100644 --- a/README.rst +++ b/README.rst @@ -24,8 +24,6 @@ Add the following to your conf.py: import guzzle_sphinx_theme - # Adds an HTML table visitor to apply Bootstrap table classes - html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator' html_theme_path = guzzle_sphinx_theme.html_theme_path() html_theme = 'guzzle_sphinx_theme' @@ -45,8 +43,6 @@ example shows: import guzzle_sphinx_theme - # Adds an HTML table visitor to apply Bootstrap table classes - html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator' html_theme_path = guzzle_sphinx_theme.html_theme_path() html_theme = 'guzzle_sphinx_theme' diff --git a/demo/conf.py b/demo/conf.py index c1ee964..842069a 100644 --- a/demo/conf.py +++ b/demo/conf.py @@ -26,7 +26,6 @@ import guzzle_sphinx_theme extensions.append("guzzle_sphinx_theme") -html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator' html_theme_path = guzzle_sphinx_theme.html_theme_path() html_theme = 'guzzle_sphinx_theme' diff --git a/guzzle_sphinx_theme/__init__.py b/guzzle_sphinx_theme/__init__.py index 4fb1930..78363a2 100644 --- a/guzzle_sphinx_theme/__init__.py +++ b/guzzle_sphinx_theme/__init__.py @@ -16,6 +16,7 @@ def setup(app): """Setup conntects events to the sitemap builder""" app.connect('html-page-context', add_html_link) app.connect('build-finished', create_sitemap) + app.set_translator('html', HTMLTranslator) app.sitemap_links = [] diff --git a/requirements.txt b/requirements.txt index dd2bcd8..ce3b3c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -Sphinx>=1.1.3,<1.3 +Sphinx>1.3 diff --git a/setup.py b/setup.py index 306b783..ca2964b 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ url='https://github.com/guzzle/guzzle_sphinx_theme', packages=['guzzle_sphinx_theme'], include_package_data=True, - install_requires=['Sphinx>=1.2b1'], + install_requires=['Sphinx>1.3'], classifiers=( 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers',