mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Decl styling, fixes from review
This commit is contained in:
parent
a840b9e4d6
commit
da5b8e41e3
@ -119,13 +119,13 @@ class toctree(nodes.General, nodes.Element, translatable):
|
||||
# Domain-specific object descriptions (class, function etc.)
|
||||
#############################################################
|
||||
|
||||
class _desc_classes_injector(nodes.TextElement):
|
||||
class _desc_classes_injector(nodes.Element):
|
||||
"""Helper base class for injecting a fixes list of classes.
|
||||
|
||||
Use as the first base class.
|
||||
"""
|
||||
|
||||
classes = [] # type: List[str]
|
||||
classes: List[str] = []
|
||||
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
||||
super().__init__(*args, **kwargs)
|
||||
|
@ -233,7 +233,7 @@ class SigElementFallbackTransform(SphinxPostTransform):
|
||||
node.replace_self(newnode)
|
||||
|
||||
|
||||
class DescSigAddDomainAsClass(SphinxPostTransform):
|
||||
class PropagateDescDomain(SphinxPostTransform):
|
||||
"""Add the domain name of the parent node as a class in each desc_signature node."""
|
||||
default_priority = 200
|
||||
|
||||
@ -246,7 +246,7 @@ def setup(app: Sphinx) -> Dict[str, Any]:
|
||||
app.add_post_transform(ReferencesResolver)
|
||||
app.add_post_transform(OnlyNodeTransform)
|
||||
app.add_post_transform(SigElementFallbackTransform)
|
||||
app.add_post_transform(DescSigAddDomainAsClass)
|
||||
app.add_post_transform(PropagateDescDomain)
|
||||
|
||||
return {
|
||||
'version': 'builtin',
|
||||
|
Loading…
Reference in New Issue
Block a user