mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
autosummary: small signature formatting fixes
This commit is contained in:
@@ -229,7 +229,7 @@ class Autosummary(Directive):
|
||||
if not sig:
|
||||
sig = ''
|
||||
else:
|
||||
sig = mangle_signature(sig)
|
||||
sig = mangle_signature(sig).replace('*', r'\*')
|
||||
|
||||
# -- Grab the summary
|
||||
|
||||
@@ -312,8 +312,10 @@ def mangle_signature(sig, max_chars=30):
|
||||
args.append('...')
|
||||
break
|
||||
|
||||
if opts:
|
||||
if opts and args:
|
||||
sig = ", ".join(args) + "[, " + ", ".join(opts) + "]"
|
||||
elif opts and not args:
|
||||
sig = "[" + ", ".join(opts) + "]"
|
||||
else:
|
||||
sig = ", ".join(args)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user