From 357997dc7dd88d23c3c03a11e70ea39d5a83d720 Mon Sep 17 00:00:00 2001 From: rob Date: Wed, 31 Dec 2025 23:10:34 -0400 Subject: [PATCH] Fix docs heading format for template compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convert (id, title) tuples to SimpleNamespace objects with id, text, and level attributes to match template expectations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/smarttools/web/routes.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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: