From ca146ac18be3fdb9108b8d9dcb0b165ee62e56df Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 12 Sep 2021 19:18:21 +0900 Subject: [PATCH] Close #9623: Allow to suppress warnings on excluded document found in toctree --- CHANGES | 3 +++ doc/usage/configuration.rst | 1 + sphinx/directives/other.py | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 9e8bc1151e7..331f14d81ab 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 a6607e57eb9..dba3cc83128 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 f04526f939c..7e5b341f00a 100644 --- a/sphinx/directives/other.py +++ b/sphinx/directives/other.py @@ -132,7 +132,8 @@ def parse_content(self, toctree: addnodes.toctree) -> List[Node]: 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: