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

MAINT: Work around Sphinx deprecation #301

Merged
merged 2 commits into from
Jan 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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