diff --git a/src/smarttools/web/routes.py b/src/smarttools/web/routes.py index 4943864..63d04e5 100644 --- a/src/smarttools/web/routes.py +++ b/src/smarttools/web/routes.py @@ -529,13 +529,28 @@ def tutorials(): @web_bp.route("/tutorials/", endpoint="tutorials_path") def tutorials_path(path: str): from .docs_content import get_doc, get_toc + doc = get_doc(path) 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=headings, + parent=doc.get("parent"), + ) return render_template( "pages/docs.html", - page=doc, + page=page, toc=get_toc(), current_path=path, + prev_page=None, + next_page=None, ) return render_template( "pages/content.html",