mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #9630: autosummary: Failed to build summary table if primary_domain is not 'py'
Autosummary generates reST code that uses raw `:obj:` xrefs to refer the python objects in the summary table. But they're fragile because they assume the primary_domain=='py'. This adds `:py:` prefix to these xrefs to make them robust.
This commit is contained in:
parent
ed227d7d3c
commit
bc012076b8
2
CHANGES
2
CHANGES
@ -18,6 +18,8 @@ Bugs fixed
|
|||||||
|
|
||||||
* #9630: autodoc: Failed to build cross references if :confval:`primary_domain`
|
* #9630: autodoc: Failed to build cross references if :confval:`primary_domain`
|
||||||
is not 'py'
|
is not 'py'
|
||||||
|
* #9630: autosummary: Failed to build summary table if :confval:`primary_domain`
|
||||||
|
is not 'py'
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -444,9 +444,9 @@ class Autosummary(SphinxDirective):
|
|||||||
for name, sig, summary, real_name in items:
|
for name, sig, summary, real_name in items:
|
||||||
qualifier = 'obj'
|
qualifier = 'obj'
|
||||||
if 'nosignatures' not in self.options:
|
if 'nosignatures' not in self.options:
|
||||||
col1 = ':%s:`%s <%s>`\\ %s' % (qualifier, name, real_name, rst.escape(sig))
|
col1 = ':py:%s:`%s <%s>`\\ %s' % (qualifier, name, real_name, rst.escape(sig))
|
||||||
else:
|
else:
|
||||||
col1 = ':%s:`%s <%s>`' % (qualifier, name, real_name)
|
col1 = ':py:%s:`%s <%s>`' % (qualifier, name, real_name)
|
||||||
col2 = summary
|
col2 = summary
|
||||||
append_row(col1, col2)
|
append_row(col1, col2)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user