ENH/MAINT: avoid overwriting the HtmlTranslator #1024
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #143, Fix #94
In this PR I tried to get rid of the custom
BootstrapHTML5Translator
. To remain compatible with what was built previously I simply edit the table nodes using a Sphinxpost_transform
.here:
https://github.com/pydata/pydata-sphinx-theme/blob/main/src/pydata_sphinx_theme/bootstrap_html_translator.py#L24
We add an
aria-level
on a specific component of the output. In fact, what is done is a rough overwriting of this:https://github.com/sphinx-doc/sphinx/blob/fa6d42597f2c1259ccdd9166763657bd9c2a316e/sphinx/writers/html5.py#L370
I don't manage to make it work with a
post_transform
so I think the solution is a directive overwrite. Before I loose some hair on this one, can someone explain why it's relevant for the theme ?PS: this work is a WIP but I wanted to see the distant build to try to understand why there is this
aria-level
addition.PPS: of course I will drop the second python file entirely when this will work