summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-11-10 01:43:59 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-11-10 01:43:59 +0900
commit22bec4ffe43babda23a8f0a8db0c7f5b87a24a18 (patch)
treebe91b74462a51ad1d9de5512292c86f41b9fb538
parentca146ac18be3fdb9108b8d9dcb0b165ee62e56df (diff)
downloadsphinx-git-22bec4ffe43babda23a8f0a8db0c7f5b87a24a18.tar.gz
Fix #9623: Separate warning type 'toc.not_readable' to 'toc.excluded'
-rw-r--r--doc/usage/configuration.rst5
-rw-r--r--sphinx/directives/other.py4
2 files changed, 8 insertions, 1 deletions
diff --git a/doc/usage/configuration.rst b/doc/usage/configuration.rst
index dba3cc831..395708b57 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.excluded``
* ``toc.not_readable``
* ``toc.secnum``
* ``epub.unknown_project_files``
@@ -361,6 +362,10 @@ General configuration
Added ``epub.duplicated_toc_entry``
+ .. versionchanged:: 4.3
+
+ Added ``toc.excluded`` and ``toc.not_readable``
+
.. confval:: needs_sphinx
If set to a ``major.minor`` version string like ``'1.1'``, Sphinx will
diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py
index 7e5b341f0..03eb6d3d2 100644
--- a/sphinx/directives/other.py
+++ b/sphinx/directives/other.py
@@ -129,10 +129,12 @@ class TocTree(SphinxDirective):
elif docname not in self.env.found_docs:
if excluded(self.env.doc2path(docname, None)):
message = __('toctree contains reference to excluded document %r')
+ subtype = 'excluded'
else:
message = __('toctree contains reference to nonexisting document %r')
+ subtype = 'not_readable'
- logger.warning(message, docname, type='toc', subtype='not_readable',
+ logger.warning(message, docname, type='toc', subtype=subtype,
location=toctree)
self.env.note_reread()
else: