summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-09-12 19:18:21 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-09-12 19:23:19 +0900
commitca146ac18be3fdb9108b8d9dcb0b165ee62e56df (patch)
treefd8398253f12051fcd13b06f1c4978e0079ea362
parent5c4f741fffa0d698e82d31b3dd76c34982d313b5 (diff)
downloadsphinx-git-ca146ac18be3fdb9108b8d9dcb0b165ee62e56df.tar.gz
Close #9623: Allow to suppress warnings on excluded document found in toctree
-rw-r--r--CHANGES3
-rw-r--r--doc/usage/configuration.rst1
-rw-r--r--sphinx/directives/other.py3
3 files changed, 6 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 9e8bc1151..331f14d81 100644
--- a/CHANGES
+++ b/CHANGES
@@ -13,6 +13,9 @@ Deprecated
Features added
--------------
+* #9623: Allow to suppress "toctree contains reference to excluded document"
+ warnings using :confval:`suppress_warnings`
+
Bugs fixed
----------
diff --git a/doc/usage/configuration.rst b/doc/usage/configuration.rst
index a6607e57e..dba3cc831 100644
--- a/doc/usage/configuration.rst
+++ b/doc/usage/configuration.rst
@@ -329,6 +329,7 @@ General configuration
* ``ref.python``
* ``misc.highlighting_failure``
* ``toc.circular``
+ * ``toc.not_readable``
* ``toc.secnum``
* ``epub.unknown_project_files``
* ``epub.duplicated_toc_entry``
diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py
index f04526f93..7e5b341f0 100644
--- a/sphinx/directives/other.py
+++ b/sphinx/directives/other.py
@@ -132,7 +132,8 @@ class TocTree(SphinxDirective):
else:
message = __('toctree contains reference to nonexisting document %r')
- logger.warning(message, docname, location=toctree)
+ logger.warning(message, docname, type='toc', subtype='not_readable',
+ location=toctree)
self.env.note_reread()
else:
if docname in all_docnames: