Skip to content

Commit

Permalink
[toctree] Adding warning type/subtype toc.no_title (#12479)
Browse files Browse the repository at this point in the history
Add warning type and subtype to warning generated in toctree
  • Loading branch information
onavratil-monetplus authored Jun 27, 2024
1 parent 751e916 commit 3b3a7d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/usage/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion sphinx/environment/adapters/toctree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3b3a7d9

Please sign in to comment.