Skip to content

Commit

Permalink
Merge pull request #64 from decherd/fix-tutorial-app-loading
Browse files Browse the repository at this point in the history
Fix: Tutorial App not loading #63
  • Loading branch information
Isaac-Flath authored Feb 10, 2025
2 parents 3dced70 + b850456 commit 37b4064
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions docs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,24 +165,8 @@ def theme_switcher(request):

gs_path = Path('getting_started')

@rt('/getting_started')
@rt('/getting_started/{o}')
def getting_started(o:str='', request=None):
if o=='md': return PlainTextResponse(read_html(f'https://monsterui.answer.ai/getting_started', sel='#content'))
if o=='rmd': return Div(render_md(read_html(f'https://monsterui.answer.ai/getting_started', sel='#content')))
content = Container(render_md(open(gs_path/'GettingStarted.md').read()))
return _create_page(content,
request,
'Getting Started')
@rt('/')
@rt('/{o}')
def index(o:str='', request=None):
if o=='md': return PlainTextResponse(read_html(f'https://monsterui.answer.ai', sel='#content'))
if o=='rmd': return Div(render_md(read_html(f'https://monsterui.answer.ai', sel='#content')))
return getting_started('')

@rt('/tutorial_app2')
@rt('/tutorial_app2/{o}')
@rt('/tutorial_app')
@rt('/tutorial_app/{o}')
def tutorial_app(o:str='', request=None):
pass
if o=='md': return PlainTextResponse(read_html(f'https://monsterui.answer.ai/tutorial_app', sel='#content'))
Expand All @@ -207,6 +191,13 @@ def tutorial_app(o:str='', request=None):
app_rendered)
return _create_page(content, request, 'Getting Started')

@rt('/')
@rt('/{o}')
def index(o:str='', request=None):
if o=='md': return PlainTextResponse(read_html(f'https://monsterui.answer.ai/getting_started', sel='#content'))
if o=='rmd': return Div(render_md(read_html(f'https://monsterui.answer.ai/getting_started', sel='#content')))
content = Container(render_md(open(gs_path/'GettingStarted.md').read()))
return _create_page(content, request, 'Getting Started')

###
# Build the Sidebar
Expand All @@ -219,8 +210,8 @@ def create_li(title, href):
return NavContainer(
NavParentLi(
A(DivFullySpaced("Getting Started", )),
NavContainer(create_li("Getting Started", getting_started),
create_li("Tutorial App", '/tutorial_app'),
NavContainer(create_li("Getting Started", index),
create_li("Tutorial App", tutorial_app),
parent=False),
cls='uk-open' if open_section=='Getting Started' else ''
),
Expand Down

0 comments on commit 37b4064

Please sign in to comment.