mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix astext() for two Sphinx nodes
This commit is contained in:
parent
63457c700c
commit
a40f1ad473
@ -112,6 +112,13 @@ class desc_signature(nodes.Part, nodes.Inline, nodes.TextElement):
|
|||||||
In that case all child nodes must be ``desc_signature_line`` nodes.
|
In that case all child nodes must be ``desc_signature_line`` nodes.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@property
|
||||||
|
def child_text_separator(self):
|
||||||
|
if self.get('is_multiline'):
|
||||||
|
return ' '
|
||||||
|
else:
|
||||||
|
return super().child_text_separator
|
||||||
|
|
||||||
|
|
||||||
class desc_signature_line(nodes.Part, nodes.Inline, nodes.FixedTextElement):
|
class desc_signature_line(nodes.Part, nodes.Inline, nodes.FixedTextElement):
|
||||||
"""Node for a line in a multi-line object signatures.
|
"""Node for a line in a multi-line object signatures.
|
||||||
@ -150,6 +157,9 @@ class desc_parameterlist(nodes.Part, nodes.Inline, nodes.FixedTextElement):
|
|||||||
"""Node for a general parameter list."""
|
"""Node for a general parameter list."""
|
||||||
child_text_separator = ', '
|
child_text_separator = ', '
|
||||||
|
|
||||||
|
def astext(self):
|
||||||
|
return '({})'.format(super().astext())
|
||||||
|
|
||||||
|
|
||||||
class desc_parameter(nodes.Part, nodes.Inline, nodes.FixedTextElement):
|
class desc_parameter(nodes.Part, nodes.Inline, nodes.FixedTextElement):
|
||||||
"""Node for a single parameter."""
|
"""Node for a single parameter."""
|
||||||
|
Loading…
Reference in New Issue
Block a user