Fix docs heading format for template compatibility
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 <[email protected]>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user