Skip to content

Commit

Permalink
Merge branch 'features/sphinx-ext-refactoring'
Browse files Browse the repository at this point in the history
This change sets up the sphinx extension to explicitly require
Sphinx of v1.6 or higher. It also registers the theme path
unconditionally and sets a version string in the extension metadata.
  • Loading branch information
webknjaz committed Jul 11, 2020
2 parents 7c7b67c + 2c48e79 commit c564d97
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions sphinx_ansible_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,20 @@ def get_html_theme_path():
# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
def setup(app):
"""Sphinx entry point."""
if sphinx.version_info >= (1, 6, 0):
# Register the theme that can be referenced without adding a theme path
app.add_html_theme("sphinx_ansible_theme", path.abspath(path.dirname(__file__)))
app.require_sphinx("1.6")
# Register the theme that can be referenced without adding a theme path
app.add_html_theme(
"sphinx_ansible_theme", path.abspath(path.dirname(__file__)),
)

if sphinx.version_info >= (1, 8, 0):
# Add Sphinx message catalog for newer versions of Sphinx
# See http://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_message_catalog
rtd_locale_path = path.join(path.abspath(path.dirname(__file__)), "locale")
app.add_message_catalog("sphinx", rtd_locale_path)

return {"parallel_read_safe": True, "parallel_write_safe": True}
return {
"parallel_read_safe": True,
"parallel_write_safe": True,
"version": __version_full__,
}

0 comments on commit c564d97

Please sign in to comment.