diff --git a/AUTHORS.rst b/AUTHORS.rst index 091a87ebdba..f57795d4fa7 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -96,6 +96,7 @@ Contributors * \A. Rafey Khan -- improved intersphinx typing * Roland Meister -- epub builder * Sebastian Wiesner -- image handling, distutils support +* Slawek Figiel -- additional warning suppression * Stefan Seefeld -- toctree improvements * Stefan van der Walt -- autosummary extension * \T. Powers -- HTML output improvements diff --git a/CHANGES.rst b/CHANGES.rst index a4f3efb0618..8f856b1f620 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -46,6 +46,10 @@ Features added Patch by Adam Turner. * #13065: Enable colour by default in when running on CI. Patch by Adam Turner. +* Allow supressing warnings from the :rst:dir:`toctree` directive when a glob + pattern doesn't match any documents, via the new ``toc.glob_not_matching`` + warning sub-type. + Patch by Slawek Figiel. Bugs fixed ---------- diff --git a/doc/usage/configuration.rst b/doc/usage/configuration.rst index 6b23825a3fb..40691c202cd 100644 --- a/doc/usage/configuration.rst +++ b/doc/usage/configuration.rst @@ -1393,6 +1393,7 @@ Options for warning control * ``misc.copy_overwrite`` * ``misc.highlighting_failure`` * ``toc.circular`` + * ``toc.empty_glob`` * ``toc.excluded`` * ``toc.no_title`` * ``toc.not_readable`` @@ -1449,6 +1450,8 @@ Options for warning control .. versionadded:: 8.2 Added ``duplicate_declaration.c`` and ``duplicate_declaration.cpp``. + .. versionadded:: 8.2 + Added ``toc.empty_glob``. Builder options =============== diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py index 4ab17cc7042..1242138b5b1 100644 --- a/sphinx/directives/other.py +++ b/sphinx/directives/other.py @@ -120,6 +120,7 @@ def parse_content(self, toctree: addnodes.toctree) -> None: __("toctree glob pattern %r didn't match any documents"), entry, location=toctree, + subtype='empty_glob', ) for docname in doc_names: