Skip to content

Add custom sphinx translator dynamically with a mixin #143

@jorisvandenbossche

Description

@jorisvandenbossche

Originally posted by @humitos in #95 (comment)

FYI, I changed the way that we are handling this in sphinx-hoverxref for a more permissive way. Instead of overriding the translator completely, I'm just adding the behavior that I need by creating a new class dynamically and inheriting from the translator define by the user (or extension) plus my mixin class with the behavior I need.

This allowed me to make my extension compatible with your theme. I just tested this theme with my extension and they both work nicely together!

So, if you think that you can be compatible with other HTML5Translator that the user could define, you may want to follow a similar pattern to avoid the same problem that I had with your theme.

See the PR at readthedocs/sphinx-hoverxref#42

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions