mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #943: In autosummary, recognize "first sentences" to pull from the docstring if they contain uppercase letters.
This commit is contained in:
3
CHANGES
3
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
|
||||
-------------
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user