Bläddra i källkod

show left menu button on documentation pages

Falko Schindler 1 år sedan
förälder
incheckning
691f574ea0
1 ändrade filer med 8 tillägg och 6 borttagningar
  1. 8 6
      website/documentation/rendering.py

+ 8 - 6
website/documentation/rendering.py

@@ -13,21 +13,23 @@ from .reference import generate_class_doc
 def render_page(documentation: DocumentationPage, *, with_menu: bool = True) -> None:
 def render_page(documentation: DocumentationPage, *, with_menu: bool = True) -> None:
     """Render the documentation."""
     """Render the documentation."""
 
 
-    # header
-    add_head_html()
-    add_header()
-    ui.add_head_html('<style>html {scroll-behavior: auto;}</style>')
-
     # menu
     # menu
     if with_menu:
     if with_menu:
         with ui.left_drawer() \
         with ui.left_drawer() \
                 .classes('column no-wrap gap-1 bg-[#eee] dark:bg-[#1b1b1b] mt-[-20px] px-8 py-20') \
                 .classes('column no-wrap gap-1 bg-[#eee] dark:bg-[#1b1b1b] mt-[-20px] px-8 py-20') \
-                .style('height: calc(100% + 20px) !important'):
+                .style('height: calc(100% + 20px) !important') as menu:
             if documentation.back_link:
             if documentation.back_link:
                 ui.markdown(f'[← back]({documentation.back_link or "."})').classes('bold-links')
                 ui.markdown(f'[← back]({documentation.back_link or "."})').classes('bold-links')
             else:
             else:
                 ui.markdown('[← Overview](/documentation)').classes('bold-links')
                 ui.markdown('[← Overview](/documentation)').classes('bold-links')
             ui.markdown(f'**{documentation.heading.replace("*", "")}**').classes('mt-4')
             ui.markdown(f'**{documentation.heading.replace("*", "")}**').classes('mt-4')
+    else:
+        menu = None
+
+    # header
+    add_head_html()
+    add_header(menu)
+    ui.add_head_html('<style>html {scroll-behavior: auto;}</style>')
 
 
     # content
     # content
     def render_content():
     def render_content():