mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Give line number info where possible in toctree-related warnings.
This commit is contained in:
parent
9d4f8c4a16
commit
33647ec898
@ -1240,11 +1240,12 @@ class BuildEnvironment:
|
||||
self.warn(docname,
|
||||
'toctree contains reference to document '
|
||||
'%r that doesn\'t have a title: no link '
|
||||
'will be generated' % ref)
|
||||
'will be generated' % ref, toctreenode.line)
|
||||
except KeyError:
|
||||
# this is raised if the included file does not exist
|
||||
self.warn(docname, 'toctree contains reference to '
|
||||
'nonexisting document %r' % ref)
|
||||
'nonexisting document %r' % ref,
|
||||
toctreenode.line)
|
||||
else:
|
||||
# if titles_only is given, only keep the main title and
|
||||
# sub-toctrees
|
||||
|
Loading…
Reference in New Issue
Block a user