summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-07-24 00:10:38 +0900
committerGitHub <noreply@github.com>2018-07-24 00:10:38 +0900
commit6b4a4a91972627aae48c7d07784c7f8ff04c2a1f (patch)
treec4de1029956d7a293344ecc3d5277bbee90dfcff
parenta57b9ccdf7ca889ac52f686a51aa8e4855919f3c (diff)
parent6646b68ec425feefa699a0083fac899c12ab9342 (diff)
downloadsphinx-git-6b4a4a91972627aae48c7d07784c7f8ff04c2a1f.tar.gz
Merge pull request #5204 from tk0miya/344_autosummary_recognizes_docstring_of_modattrs
Fix #344: autosummary does not understand docstring of module level attributes
-rw-r--r--CHANGES1
-rw-r--r--sphinx/ext/autodoc/__init__.py5
2 files changed, 6 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 89aef3572..d90f9ee88 100644
--- a/CHANGES
+++ b/CHANGES
@@ -176,6 +176,7 @@ Bugs fixed
* #5133: latex: index headings "Symbols" and "Numbers" not internationalized
* #5114: sphinx-build: Handle errors on scanning documents
* epub: spine has been broken when "self" is listed on toctree (refs: #4611)
+* #344: autosummary does not understand docstring of module level attributes
Testing
--------
diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py
index 62143fda4..4a9b59537 100644
--- a/sphinx/ext/autodoc/__init__.py
+++ b/sphinx/ext/autodoc/__init__.py
@@ -1265,6 +1265,11 @@ class DataDocumenter(ModuleLevelDocumenter):
# type: (bool) -> None
pass
+ def get_real_modname(self):
+ # type: () -> str
+ return self.get_attr(self.parent or self.object, '__module__', None) \
+ or self.modname
+
class MethodDocumenter(DocstringSignatureMixin, ClassLevelDocumenter): # type: ignore
"""