add pytests

This commit is contained in:
Jared Dillard
2025-05-16 01:17:29 -07:00
parent 19f42aa8cc
commit 012674a934
10 changed files with 297 additions and 4 deletions
+7 -4
View File
@@ -74,7 +74,9 @@ class LLMSFullManager:
if toctree:
from docutils import nodes
for node in toctree.traverse(nodes.reference):
# Use findall() instead of traverse() to avoid deprecation warning
# Convert generator to list for iteration
for node in list(toctree.findall(nodes.reference)):
if "refuri" in node.attributes:
refuri = node.attributes["refuri"]
if refuri and refuri.endswith(".html"):
@@ -239,9 +241,10 @@ def doctree_resolved(app: Sphinx, doctree, docname: str):
from docutils import nodes
title = None
for node in doctree.traverse(nodes.title):
title = node.astext()
break
# findall() returns a generator, convert to list to check if it has elements
title_nodes = list(doctree.findall(nodes.title))
if title_nodes:
title = title_nodes[0].astext()
if title:
_manager.update_page_title(docname, title)