summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-01-11 09:11:03 +0100
committerGeorg Brandl <georg@python.org>2014-01-11 09:11:03 +0100
commitf1c65743887f1e768531dea6353d9cacddd0f12f (patch)
tree73e5f7ae67b150de3389d7cd57c89996b62d10eb
parent818f76e027a2f4f7ea44dcf8dc70bee2a3118d8b (diff)
downloadsphinx-f1c65743887f1e768531dea6353d9cacddd0f12f.tar.gz
Closes #943: In autosummary, recognize "first sentences" to pull from the docstring if they contain uppercase letters.
-rw-r--r--CHANGES3
-rw-r--r--sphinx/ext/autosummary/__init__.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 3077ee31..d76c26f7 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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
-------------
diff --git a/sphinx/ext/autosummary/__init__.py b/sphinx/ext/autosummary/__init__.py
index a73e79f5..af0fa65c 100644
--- a/sphinx/ext/autosummary/__init__.py
+++ b/sphinx/ext/autosummary/__init__.py
@@ -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: