Skip to content

Commit 5b8735d

Browse files
committed
Expand docstrings of new nodes' classes
1 parent 7c016c9 commit 5b8735d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

sphinx/addnodes.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,26 @@ def astext(self) -> str:
242242

243243

244244
class desc_parameterlist(nodes.Part, nodes.Inline, nodes.FixedTextElement):
245-
"""Node for a general parameter list."""
245+
"""Node for a general parameter list.
246+
247+
As default the parameter list is written in line with the rest of the signature.
248+
Set ``is_multi_line = True`` to describe a multi-line parameter list. In that case
249+
all child nodes must be :py:class:`desc_parameter_line` nodes, and each parameter
250+
will then be written on its own, indented line.
251+
"""
246252
child_text_separator = ', '
247253

248254
def astext(self):
249255
return f'({super().astext()})'
250256

251257

252258
class desc_parameter_line(nodes.General, nodes.Element):
259+
"""Node for a single, indented parameter line.
260+
261+
It should only be used as a child of a :py:class:`desc_parameterlist` with
262+
``is_multi_line`` set to ``True``, and have a single :py:class:`desc_parameter`
263+
child.
264+
"""
253265

254266

255267
class desc_parameter(nodes.Part, nodes.Inline, nodes.FixedTextElement):

0 commit comments

Comments
 (0)