Skip to content

Commit

Permalink
Fix sphinx-doc#9623: Separate warning type 'toc.not_readable' to 'toc…
Browse files Browse the repository at this point in the history
….excluded'
  • Loading branch information
tk0miya committed Nov 9, 2021
1 parent ca146ac commit 22bec4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions doc/usage/configuration.rst
Expand Up @@ -329,6 +329,7 @@ General configuration
* ``ref.python``
* ``misc.highlighting_failure``
* ``toc.circular``
* ``toc.excluded``
* ``toc.not_readable``
* ``toc.secnum``
* ``epub.unknown_project_files``
Expand Down Expand Up @@ -361,6 +362,10 @@ General configuration

Added ``epub.duplicated_toc_entry``

.. versionchanged:: 4.3

Added ``toc.excluded`` and ``toc.not_readable``

.. confval:: needs_sphinx

If set to a ``major.minor`` version string like ``'1.1'``, Sphinx will
Expand Down
4 changes: 3 additions & 1 deletion sphinx/directives/other.py
Expand Up @@ -129,10 +129,12 @@ def parse_content(self, toctree: addnodes.toctree) -> List[Node]:
elif docname not in self.env.found_docs:
if excluded(self.env.doc2path(docname, None)):
message = __('toctree contains reference to excluded document %r')
subtype = 'excluded'
else:
message = __('toctree contains reference to nonexisting document %r')
subtype = 'not_readable'

logger.warning(message, docname, type='toc', subtype='not_readable',
logger.warning(message, docname, type='toc', subtype=subtype,
location=toctree)
self.env.note_reread()
else:
Expand Down

0 comments on commit 22bec4f

Please sign in to comment.