Skip to content

Commit

Permalink
MAINT: Work around Sphinx deprecation (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Jan 26, 2021
1 parent 8a203b7 commit 270bf6c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pydata_sphinx_theme/bootstrap_html_translator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""A custom Sphinx HTML Translator for Bootstrap layout
"""
from distutils.version import LooseVersion
from docutils import nodes

import sphinx
from sphinx.writers.html5 import HTML5Translator
from sphinx.util import logging
from sphinx.ext.autosummary import autosummary_table
Expand All @@ -24,7 +26,10 @@ def visit_table(self, node):
# type: (nodes.Element) -> None
# copy of sphinx source to *not* add 'docutils' and 'align-default' classes
# but add 'table' class
self.generate_targets_for_table(node)

# generate_targets_for_table is deprecated in 4.0
if LooseVersion(sphinx.__version__) < LooseVersion("4.0"):
self.generate_targets_for_table(node)

self._table_row_index = 0

Expand Down

0 comments on commit 270bf6c

Please sign in to comment.