Skip to content

Commit

Permalink
improve overview routing
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Dec 1, 2023
1 parent 2e849a8 commit 1c9b9d4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _main_page() -> None:

@ui.page('/documentation')
def _documentation_page() -> None:
documentation.render_page(documentation.registry['overview'], is_main=True)
documentation.render_page(documentation.registry[''], with_menu=False)


@ui.page('/documentation/{name}')
Expand Down
2 changes: 2 additions & 0 deletions website/documentation/content/doc/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def _get_current_page() -> DocumentationPage:
module = inspect.getmodule(frame)
assert module is not None and module.__file__ is not None
name = _removesuffix(Path(module.__file__).stem, '_documentation')
if name == 'overview':
name = ''
if name not in registry:
registry[name] = DocumentationPage(name=name)
return registry[name]
Expand Down
4 changes: 2 additions & 2 deletions website/documentation/rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .reference import generate_class_doc


def render_page(documentation: DocumentationPage, *, is_main: bool = False) -> None:
def render_page(documentation: DocumentationPage, *, with_menu: bool = True) -> None:
"""Render the documentation."""

# header
Expand All @@ -19,7 +19,7 @@ def render_page(documentation: DocumentationPage, *, is_main: bool = False) -> N
ui.add_head_html('<style>html {scroll-behavior: auto;}</style>')

# menu
if not is_main:
if with_menu:
with ui.left_drawer() \
.classes('column no-wrap gap-1 bg-[#eee] dark:bg-[#1b1b1b] mt-[-20px] px-8 py-20') \
.style('height: calc(100% + 20px) !important'):
Expand Down

0 comments on commit 1c9b9d4

Please sign in to comment.