[toctree] Adding warning type/subtype toc.no_title (#12479)

Add warning type and subtype to warning generated in toctree
This commit is contained in:
Ondřej Navrátil 2024-06-27 23:34:46 +02:00 committed by GitHub
parent 751e9162c0
commit 3b3a7d911b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -366,6 +366,7 @@ General configuration
* ``toc.excluded``
* ``toc.not_readable``
* ``toc.secnum``
* ``toc.no_title``
Extensions can also define their own warning types.
Those defined by the first-party ``sphinx.ext`` extensions are:

View File

@ -316,7 +316,7 @@ def _toctree_entry(
# empty toc means: no titles will show up in the toctree
logger.warning(__('toctree contains reference to document %r that '
"doesn't have a title: no link will be generated"),
ref, location=toctreenode)
ref, location=toctreenode, type='toc', subtype='no_title')
except KeyError:
# this is raised if the included file does not exist
ref_path = env.doc2path(ref, False)