pydata-sphinx-theme icon indicating copy to clipboard operation
pydata-sphinx-theme copied to clipboard

Setting any translator in extension changes table class

Open matthew-brett opened this issue 10 months ago • 2 comments

This is a boiled down version of https://github.com/matthew-brett/nb2plots/issues/27

The take-home is that adding the following lines in a Sphinx extension:

# myext.py
from docutils import nodes

def setup(app):
    app.set_translator('foo', nodes.NodeVisitor)

causes the HTML emited via pydata-sphinx-theme to change the table class from class="table" to class="docutils align-default".

Specifically, with the following conf.py:

import os.path as op
import sys
sys.path.append(op.abspath('.'))

extensions = [
    "myext",
]

html_theme = "pydata_sphinx_theme"

and the extension myext.py above, the emitted HTML has:

<table class="docutils align-default" id="id1">

whereas, with "myext" commented out in the conf.py file, I get:

<table class="table" id="id1">

Minimal reproducible example at https://github.com/matthew-brett/pydata-theme-test with instructions.

matthew-brett avatar Aug 19 '23 14:08 matthew-brett