|
from .my_dashboard import dashboard as my_dashboard |
|
from typing import Dict, Callable |
|
|
|
|
|
app_routes = { |
|
"/": main_layout, |
|
"/my_dashboard": my_dashboard, |
|
} |
|
|
|
def app() -> Dict[str, Callable]: |
|
return app_routes |
|
|
|
|
|
pn.extension(sizing_mode="stretch_width") |
|
|
|
nav_markdown = """ |
|
# Navigation |
|
- [My Dashboard](/my_dashboard) |
|
""" |
|
|
|
navigation = pn.Markdown(nav_markdown) |
|
|
|
main_layout = pn.Column( |
|
navigation, |
|
|
|
) |
|
|
|
INTRO = """ |
|
# Awesome Panel on Hugging Face Spaces |
|
... (rest of the content) |
|
""" |
|
|
|
some_component = pn.panel(INTRO) |
|
|
|
|
|
|
|
template = pn.template.FastListTemplate( |
|
site="Awesome Panel 🤗", title="Hello Hugging Face World", main=[some_component], |
|
favicon="https://sharing.awesome-panel.org/favicon.ico", accent="#fef3c7", header_color="#4b5563" |
|
) |
|
|
|
app = pn.serve({'/': template, '/my_dashboard': my_dashboard_app}, return_views=True) |