[IMP] odoo_theme: tweak the HTML structure of TOC entries

task-3046383

X-original-commit: 877d1de3c2
Part-of: odoo/documentation#4113
This commit is contained in:
Antoine Vandevenne (anv)
2023-01-03 14:12:48 +00:00
parent 267b9ec0dd
commit 9c362035e8
2 changed files with 55 additions and 40 deletions
+4 -4
View File
@@ -32,15 +32,15 @@ class Dfn(SphinxRole):
sphinx.nodes.* class to prevent automatically setting the name of the node as class (e.g.,
"container") on the element.
"""
outer_span = Span(classes=['dfn'])
inner_span = Span()
outer_span = DfnSpan(classes=['dfn'])
inner_span = DfnSpan()
outer_span.append(inner_span)
text = nodes.Text(self.text)
inner_span.append(text)
return [outer_span], []
class Span(nodes.General, nodes.Element):
class DfnSpan(nodes.General, nodes.Element):
@staticmethod
def visit(translator, node):
@@ -63,7 +63,7 @@ def setup(app):
lambda self, node: self.depart_admonition(node),
))
app.add_role('dfn', Dfn(), override=True)
app.add_node(Span, html=(Span.visit, Span.depart))
app.add_node(DfnSpan, html=(DfnSpan.visit, DfnSpan.depart))
return {
'parallel_read_safe': True,