Le 25/05/2022 à 19:23, Dan Sandberg a écrit :
> Hi Jean,
>
> Thanks for the reply. I saw that, but how do you use it from the
> config file? If there's no way, then it isn't really a replacement.
The setup() function in the configuration file takes the application
object and can mutate it. For example, this code in conf.py would
interpret all emphasis markup as bold:
from sphinx.writers.html import HTMLTranslator
class MyTranslator(HTMLTranslator):
def visit_emphasis(self, node):
self.visit_strong(node)
def depart_emphasis(self, node):
self.depart_strong(node)
def setup(app):
app.set_translator('html', MyTranslator)