Spaces:
Runtime error
Runtime error
Download frontend/layouts/mainlayout.py from CaffeineCrew/Techdocs: direct link, hf CLI and curl.
- Browser
- Download file 810 Bytes
-
https://huggingface.co/spaces/CaffeineCrew/Techdocs/resolve/refs%2Fpr%2F1/frontend/layouts/mainlayout.py
- Command line
-
hf download hf://spaces/CaffeineCrew/Techdocs@refs/pr/1/frontend/layouts/mainlayout.py
-
curl -L -o mainlayout.py https://huggingface.co/spaces/CaffeineCrew/Techdocs/resolve/refs%2Fpr%2F1/frontend/layouts/mainlayout.py
810 Bytes
| import json | |
| import streamlit as st | |
| from typing import Callable | |
| from components import authors, user_greetings, login, add_logo | |
| def mainlayout(func: Callable): | |
| with open("frontend/layouts/st_page_layouts.json", "r",encoding='utf-8') as f: | |
| st_page_layouts = json.load(f) | |
| st.set_page_config(**st_page_layouts[f"{func.__name__}" if func.__name__ in st_page_layouts.keys() else "home"]) | |
| add_logo("frontend/images/techdocslogo.svg",svg=True) | |
| st.markdown("## :rainbow[Welcome to Techdocs: Where Code Meets Clarity!]🚀") | |
| user_greetings() | |
| if 'access_token' not in st.session_state: | |
| st.session_state.runpage = login | |
| else: | |
| st.session_state.runpage = func | |
| def load_page(): | |
| return st.session_state.runpage() | |
| load_page() | |
| authors() | |