Skip to content

Commit bc01207

Browse files
committed
Fix sphinx-doc#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.
1 parent ed227d7 commit bc01207

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Bugs fixed
1818

1919
* #9630: autodoc: Failed to build cross references if :confval:`primary_domain`
2020
is not 'py'
21+
* #9630: autosummary: Failed to build summary table if :confval:`primary_domain`
22+
is not 'py'
2123

2224
Testing
2325
--------

sphinx/ext/autosummary/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,9 @@ def append_row(*column_texts: str) -> None:
444444
for name, sig, summary, real_name in items:
445445
qualifier = 'obj'
446446
if 'nosignatures' not in self.options:
447-
col1 = ':%s:`%s <%s>`\\ %s' % (qualifier, name, real_name, rst.escape(sig))
447+
col1 = ':py:%s:`%s <%s>`\\ %s' % (qualifier, name, real_name, rst.escape(sig))
448448
else:
449-
col1 = ':%s:`%s <%s>`' % (qualifier, name, real_name)
449+
col1 = ':py:%s:`%s <%s>`' % (qualifier, name, real_name)
450450
col2 = summary
451451
append_row(col1, col2)
452452

0 commit comments

Comments
 (0)