Merge pull request #7492 from tk0miya/7490_autosummary_caption

Close #7490: autosummary: Add ``:caption:`` option to autosummary directive
This commit is contained in:
Takeshi KOMIYA authored and GitHub committed 2020-04-20 00:52:45 +09:00
commit 12cb90c3fa
5 files changed
+18 -1

No files matched your search

@@ -5,6 +5,7 @@
.. autosummary::
:toctree: generated
:caption: An autosummary
autosummary_dummy_module
autosummary_dummy_module.Foo
+3 -1
View File
@@ -197,7 +197,7 @@ def test_autosummary_generate(app, status, warning):
nodes.paragraph,
addnodes.tabular_col_spec,
autosummary_table,
autosummary_toc))
[autosummary_toc, addnodes.toctree]))
assert_node(doctree[3],
[autosummary_table, nodes.table, nodes.tgroup, (nodes.colspec,
nodes.colspec,
@@ -205,6 +205,8 @@ def test_autosummary_generate(app, status, warning):
nodes.row,
nodes.row,
nodes.row)])])
assert_node(doctree[4][0], addnodes.toctree, caption="An autosummary")
assert doctree[3][0][0][2][0].astext() == 'autosummary_dummy_module\n\n'
assert doctree[3][0][0][2][1].astext() == 'autosummary_dummy_module.Foo()\n\n'
assert doctree[3][0][0][2][2].astext() == 'autosummary_dummy_module.bar(x[, y])\n\n'