Closes #943: In autosummary, recognize "first sentences" to pull from the docstring if they contain uppercase letters.

This commit is contained in:
Georg Brandl
2014-01-11 09:11:03 +01:00
parent c12aa9250c
commit cfecf17aed
2 changed files with 4 additions and 2 deletions

View File

@@ -36,6 +36,9 @@ Bugs fixed
* #908: On Python 3, handle error messages from LaTeX correctly in the pngmath
extension.
* #943: In autosummary, recognize "first sentences" to pull from the docstring
if they contain uppercase letters.
Documentation
-------------

View File

@@ -199,7 +199,6 @@ class Autosummary(Directive):
nodes = self.get_table(items)
if 'toctree' in self.options:
suffix = env.config.source_suffix
dirname = posixpath.dirname(env.docname)
tree_prefix = self.options['toctree'].strip()
@@ -276,7 +275,7 @@ class Autosummary(Directive):
while doc and not doc[0].strip():
doc.pop(0)
m = re.search(r"^([A-Z][^A-Z]*?\.\s)", " ".join(doc).strip())
m = re.search(r"^([A-Z].*?\.)(?:\s|$)", " ".join(doc).strip())
if m:
summary = m.group(1).strip()
elif doc: