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 1847a72cd47..1afb39a53fc 100644 --- a/sphinx/directives/other.py +++ b/sphinx/directives/other.py @@ -133,7 +133,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: