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

ENH/MAINT: avoid overwriting the HtmlTranslator #1024

Closed
wants to merge 2 commits into from

Conversation

12rambau
Copy link
Collaborator

@12rambau 12rambau commented Oct 18, 2022

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 Sphinx post_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

@choldgraf
Copy link
Collaborator

Maybe @jorisvandenbossche can provide context for why this translator exists? I believe he was the one to add it back in the day

@12rambau
Copy link
Collaborator Author

Superceeded by #1105

@12rambau 12rambau closed this Jan 14, 2023
@12rambau 12rambau deleted the translator branch January 15, 2023 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add custom sphinx translator dynamically with a mixin Avoid replacing classes for Sphinx blocks
2 participants