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,
|
self.warn(docname,
|
||||||
'toctree contains reference to document '
|
'toctree contains reference to document '
|
||||||
'%r that doesn\'t have a title: no link '
|
'%r that doesn\'t have a title: no link '
|
||||||
'will be generated' % ref)
|
'will be generated' % ref, toctreenode.line)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
# this is raised if the included file does not exist
|
# this is raised if the included file does not exist
|
||||||
self.warn(docname, 'toctree contains reference to '
|
self.warn(docname, 'toctree contains reference to '
|
||||||
'nonexisting document %r' % ref)
|
'nonexisting document %r' % ref,
|
||||||
|
toctreenode.line)
|
||||||
else:
|
else:
|
||||||
# if titles_only is given, only keep the main title and
|
# if titles_only is given, only keep the main title and
|
||||||
# sub-toctrees
|
# sub-toctrees
|
||||||
|
Loading…
Reference in New Issue
Block a user