Skip to content

Commit 67f6154

Browse files
fivittiAA-Turner
andauthored
Allow suppressing warnings for non-matching toctree glob patterns (#13230)
Co-authored-by: Adam Turner <[email protected]>
1 parent 099b91a commit 67f6154

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ Contributors
9696
* \A. Rafey Khan -- improved intersphinx typing
9797
* Roland Meister -- epub builder
9898
* Sebastian Wiesner -- image handling, distutils support
99+
* Slawek Figiel -- additional warning suppression
99100
* Stefan Seefeld -- toctree improvements
100101
* Stefan van der Walt -- autosummary extension
101102
* \T. Powers -- HTML output improvements

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ Features added
4646
Patch by Adam Turner.
4747
* #13065: Enable colour by default in when running on CI.
4848
Patch by Adam Turner.
49+
* Allow supressing warnings from the :rst:dir:`toctree` directive when a glob
50+
pattern doesn't match any documents, via the new ``toc.glob_not_matching``
51+
warning sub-type.
52+
Patch by Slawek Figiel.
4953

5054
Bugs fixed
5155
----------

doc/usage/configuration.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,7 @@ Options for warning control
13931393
* ``misc.copy_overwrite``
13941394
* ``misc.highlighting_failure``
13951395
* ``toc.circular``
1396+
* ``toc.empty_glob``
13961397
* ``toc.excluded``
13971398
* ``toc.no_title``
13981399
* ``toc.not_readable``
@@ -1449,6 +1450,8 @@ Options for warning control
14491450
.. versionadded:: 8.2
14501451
Added ``duplicate_declaration.c`` and ``duplicate_declaration.cpp``.
14511452

1453+
.. versionadded:: 8.2
1454+
Added ``toc.empty_glob``.
14521455

14531456
Builder options
14541457
===============

sphinx/directives/other.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ def parse_content(self, toctree: addnodes.toctree) -> None:
120120
__("toctree glob pattern %r didn't match any documents"),
121121
entry,
122122
location=toctree,
123+
subtype='empty_glob',
123124
)
124125

125126
for docname in doc_names:

0 commit comments

Comments
 (0)