diff --git a/src/smarttools/web/routes.py b/src/smarttools/web/routes.py index 2997288..f5cb433 100644 --- a/src/smarttools/web/routes.py +++ b/src/smarttools/web/routes.py @@ -463,11 +463,16 @@ def docs(path: str): # Get content from docs_content module doc = get_doc(current) if doc: + # Convert (id, title) tuples to objects with id, text, level attributes + headings = [ + SimpleNamespace(id=h[0], text=h[1], level=2) + for h in doc.get("headings", []) + ] page = SimpleNamespace( title=doc["title"], description=doc["description"], content_html=Markup(doc["content"]), - headings=doc.get("headings", []), + headings=headings, parent=doc.get("parent"), ) else: