mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Emit warning for nested numbered toctrees (refs: #3142)
This commit is contained in:
parent
9bba475ca9
commit
54c8c01222
1
CHANGES
1
CHANGES
@ -6,6 +6,7 @@ Features added
|
|||||||
|
|
||||||
* #3241: emit latex warning if buggy titlesec (ref #3210)
|
* #3241: emit latex warning if buggy titlesec (ref #3210)
|
||||||
* #3194: Refer the $MAKE environment variable to determine ``make`` command
|
* #3194: Refer the $MAKE environment variable to determine ``make`` command
|
||||||
|
* Emit warning for nested numbered toctrees (refs: #3142)
|
||||||
|
|
||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
@ -233,6 +233,7 @@ General configuration
|
|||||||
* ref.citation
|
* ref.citation
|
||||||
* ref.doc
|
* ref.doc
|
||||||
* misc.highlighting_failure
|
* misc.highlighting_failure
|
||||||
|
* toc.secnum
|
||||||
* epub.unknown_project_files
|
* epub.unknown_project_files
|
||||||
|
|
||||||
You can choose from these types.
|
You can choose from these types.
|
||||||
|
@ -464,10 +464,14 @@ class Toctree(EnvironmentManager):
|
|||||||
if depth == 0:
|
if depth == 0:
|
||||||
return
|
return
|
||||||
for (title, ref) in toctreenode['entries']:
|
for (title, ref) in toctreenode['entries']:
|
||||||
if url_re.match(ref) or ref == 'self' or ref in assigned:
|
if url_re.match(ref) or ref == 'self':
|
||||||
# don't mess with those
|
# don't mess with those
|
||||||
continue
|
continue
|
||||||
if ref in self.tocs:
|
elif ref in assigned:
|
||||||
|
self.env.warn_node('%s is already assigned section numbers '
|
||||||
|
'(nested numbered toctree?)' % ref,
|
||||||
|
toctreenode, type='toc', subtype='secnum')
|
||||||
|
elif ref in self.tocs:
|
||||||
secnums = self.toc_secnumbers[ref] = {}
|
secnums = self.toc_secnumbers[ref] = {}
|
||||||
assigned.add(ref)
|
assigned.add(ref)
|
||||||
_walk_toc(self.tocs[ref], secnums, depth,
|
_walk_toc(self.tocs[ref], secnums, depth,
|
||||||
|
Loading…
Reference in New Issue
Block a user