Closed mcflugen closed 4 months ago
Popping the first child off the title_node
's children seems to fix the issue—no ExtensionError
and the heading is removed from the rendered html. If this seems like a reasonable fix to you, I'm happy to submit a pull request.
diff --git a/autoapi/directives.py b/autoapi/directives.py
index ee5e3ec..fb6caa2 100644
--- a/autoapi/directives.py
+++ b/autoapi/directives.py
@@ -61,7 +61,7 @@ class NestedParse(Directive):
try:
title_node = node[0][0]
if isinstance(title_node, nodes.title):
- del node[0][0]
+ title_node.children.pop(0)
except IndexError:
pass
return node.children
That sounds like a good fix to me!
I am experiencing the same error when building the documentation for karney package:
https://readthedocs.org/projects/karney/builds/23394851/
Any chance it can be fixed in the next release?
Fixed in c4db7eb14a6235750edeb151bb79754b9dd38e21
Hi, when is thew version planned to be released?
👋 Hello!
When trying to build documentation for my project using sphinx-autoapi, I'm getting the following error,
After digging around a bit, it appears the problem may lie in
NestedParse
when it removes a heading. Although the title node is removed withdel node[0][0]
, perhaps the number of nodes is not decremented somewhere, which causes sphinx to try to iterate beyond the end of the list?Anyway, below is a minimal reproducible example that produces the error (for me, anyway).
Running the following generates the above error,
If I either remove the heading in
foobar/foo.py
or remove thedel node[0][0]
line fromNestedParse
, the error goes away and the docs build successfully.I'm using sphinx-autoapi v3.0.0 and sphinx v7.2.6.
Any ideas? Am I missing something?
Thanks!