mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
py nodes, PyVariable value
This commit is contained in:
parent
3979bbad7f
commit
e008b43683
@ -682,7 +682,11 @@ class PyVariable(PyObject):
|
|||||||
|
|
||||||
value = self.options.get('value')
|
value = self.options.get('value')
|
||||||
if value:
|
if value:
|
||||||
signode += addnodes.desc_annotation(value, ' = ' + value)
|
signode += addnodes.desc_annotation(value, '',
|
||||||
|
addnodes.desc_sig_space(),
|
||||||
|
addnodes.desc_sig_punctuation('', '='),
|
||||||
|
addnodes.desc_sig_space(),
|
||||||
|
nodes.Text(value))
|
||||||
|
|
||||||
return fullname, prefix
|
return fullname, prefix
|
||||||
|
|
||||||
|
@ -537,7 +537,12 @@ def test_pydata_signature(app):
|
|||||||
[desc_annotation, ([desc_sig_punctuation, ':'],
|
[desc_annotation, ([desc_sig_punctuation, ':'],
|
||||||
desc_sig_space,
|
desc_sig_space,
|
||||||
[pending_xref, "int"])],
|
[pending_xref, "int"])],
|
||||||
[desc_annotation, " = 1"])],
|
[desc_annotation, (
|
||||||
|
desc_sig_space,
|
||||||
|
[desc_sig_punctuation, '='],
|
||||||
|
desc_sig_space,
|
||||||
|
"1")]
|
||||||
|
)],
|
||||||
desc_content)]))
|
desc_content)]))
|
||||||
assert_node(doctree[1], addnodes.desc, desctype="data",
|
assert_node(doctree[1], addnodes.desc, desctype="data",
|
||||||
domain="py", objtype="data", noindex=False)
|
domain="py", objtype="data", noindex=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user