Skip to content

Commit

Permalink
Merge sphinx-contrib#46: Sphinx 1.6 compat
Browse files Browse the repository at this point in the history
StandaloneHTMLBuilder.default_sidebars was removed in sphinx ~1.6.

sphinx-doc/sphinx@e8e63b1

Fixes sphinx-contrib#36
  • Loading branch information
GielVanSchijndel-TomTom committed Sep 12, 2019
2 parents 1f687ef + d284a88 commit 8567e94
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sphinxcontrib/versioning/sphinx_.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ def builder_inited(app):

# Add versions.html to sidebar.
if '**' not in app.config.html_sidebars:
app.config.html_sidebars['**'] = StandaloneHTMLBuilder.default_sidebars + ['versions.html']
# default_sidebars was deprecated in Sphinx 1.6+, so only use it if possible (to maintain
# backwards compatibility), else don't use it.
try:
app.config.html_sidebars['**'] = StandaloneHTMLBuilder.default_sidebars + ['versions.html']
except AttributeError:
app.config.html_sidebars['**'] = ['versions.html']
elif 'versions.html' not in app.config.html_sidebars['**']:
app.config.html_sidebars['**'].append('versions.html')

Expand Down

0 comments on commit 8567e94

Please sign in to comment.