summaryrefslogtreecommitdiff
path: root/sphinx/templates
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-09-04 22:07:28 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-09-04 22:44:04 +0900
commit223d615011808282de2ff552a21c09153ab84316 (patch)
tree586b9fe0f4dad501f736ef2965a3ece26d185d2a /sphinx/templates
parent6c38f68dae221e8cfc70c137974b8b88bd3baaab (diff)
downloadsphinx-git-223d615011808282de2ff552a21c09153ab84316.tar.gz
Fix #9608: apidoc: module is not described if implicit namespace package
To make implicit namespace packages referencable, this outputs empty module definitions for them.
Diffstat (limited to 'sphinx/templates')
-rw-r--r--sphinx/templates/apidoc/package.rst_t4
1 files changed, 4 insertions, 0 deletions
diff --git a/sphinx/templates/apidoc/package.rst_t b/sphinx/templates/apidoc/package.rst_t
index b7380e8a0..2229c311b 100644
--- a/sphinx/templates/apidoc/package.rst_t
+++ b/sphinx/templates/apidoc/package.rst_t
@@ -19,6 +19,10 @@
{{- [pkgname, "package"] | join(" ") | e | heading }}
{% endif %}
+{%- if is_namespace %}
+.. py:module:: {{ pkgname }}
+{% endif %}
+
{%- if modulefirst and not is_namespace %}
{{ automodule(pkgname, automodule_options) }}
{% endif %}