When a blank page has sub-pages attached to it, Sphinx throws this confusing error:
Exception occurred:
File "/home/choldgraf/github/forks/python/ebp/sphinx-external-toc/sphinx_external_toc/events.py", line 294, in insert_toctrees
doctree.children[-1].extend(node_list)
IndexError: list index out of range
This is because the page is blank and has no doctree children, so the indexing above fails.
Describe the problem
When a blank page has sub-pages attached to it, Sphinx throws this confusing error:
This is because the page is blank and has no doctree children, so the indexing above fails.
Link to your repository or website
No response
Steps to reproduce
It was a bit wonky to run down this bug so I figured the easiest thing was to open a draft PR that demonstrates the problem. Check it out here: https://github.com/executablebooks/sphinx-external-toc/pull/53
The version of Python you're using
No response
Your operating system
No response
Versions of your packages
No response
Additional context
No response