Skip to content

Commit

Permalink
Fix sphinx-doc#9630: autosummary: Failed to build summary table if pr…
Browse files Browse the repository at this point in the history
…imary_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 thme robust.
  • Loading branch information
tk0miya committed Sep 14, 2021
1 parent 0be261c commit 795659c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -18,6 +18,8 @@ Bugs fixed

* #9630: autodoc: Failed to build cross references if :confval:`primary_domain`
is not 'py'
* #9630: autosummary: Failed to build summary table if :confval:`primary_domain`
is not 'py'

Testing
--------
Expand Down
4 changes: 2 additions & 2 deletions sphinx/ext/autosummary/__init__.py
Expand Up @@ -444,9 +444,9 @@ def append_row(*column_texts: str) -> None:
for name, sig, summary, real_name in items:
qualifier = 'obj'
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:
col1 = ':%s:`%s <%s>`' % (qualifier, name, real_name)
col1 = ':py:%s:`%s <%s>`' % (qualifier, name, real_name)
col2 = summary
append_row(col1, col2)

Expand Down

0 comments on commit 795659c

Please sign in to comment.