Spaces:
Runtime error
Runtime error
Merge pull request #40 from HemanthSai7/main
Browse filesFiles changed (5)
1234from .authors import authorsfrom .logout import logoutfrom .login import loginfrom .user_greetings import user_greetings12345from .authors import authorsfrom .logout import logoutfrom .login import loginfrom .user_greetings import user_greetingsfrom .logo import add_logo
1 unmodified line234567847 unmodified lines565758596061621 unmodified lineimport requestsimport streamlit as stdef login():47 unmodified linesst.error("Signup Failed")st.divider()st.subheader(":rainbow[Our Prototype in Action π¬]")with st.expander("Demo video π¬",expanded=True):st.video("frontend/images/Showcase.mp4")1 unmodified line23456747 unmodified lines555657585960611 unmodified lineimport requestsimport streamlit as stdef login():47 unmodified linesst.error("Signup Failed")st.divider()st.subheader(":rainbow[Our Prototype in Action ]π¬")with st.expander("Demo video π¬",expanded=True):st.video("frontend/images/Showcase.mp4")
1234567891011121314151 unmodified line1718192021222324252627import streamlit as stimport base64import validatorsfrom pathlib import Pathdef add_logo(logo_url: str, height: int = 120):if validators.url(logo_url) is True:logo = f"url({logo_url})"else:logo = f"url(data:image/png;base64,{base64.b64encode(Path(logo_url).read_bytes()).decode()})"st.markdown(f"""1 unmodified line[data-testid="stSidebarNav"] {{background-image: {logo};background-repeat: no-repeat;background-size: contain;padding-top: {height - 40}px;background-position: 20px 20px}}</style>""",unsafe_allow_html=True,)1234567891011121314151617181920211 unmodified line23242526272829303132333435363738394041424344454647484950515253545556import streamlit as stimport reimport base64import validatorsfrom pathlib import Pathdef add_logo(logo_url: str, height: int = 100, svg=False):if svg:svg_logo = read_svg(logo_url)b64 = base64.b64encode(svg_logo.encode("utf-8")).decode("utf-8")logo = f'url("data:image/svg+xml;base64,{b64}")'elif validators.url(logo_url):logo = f'url({logo_url})'else:logo = f'url("data:image/png;base64,{base64.b64encode(Path(logo_url).read_bytes()).decode()}")'st.markdown(f"""1 unmodified line[data-testid="stSidebarNav"] {{background-image: {logo};background-repeat: no-repeat;background-position: center top; /* Center the logo at the top */background-size: auto {height}px; /* Set the logo height */}}</style>""",unsafe_allow_html=True,)def read_svg(path_svg):try:with open(path_svg, "r") as file:svg_logo = file.read().splitlines()_maped_list = map(str, svg_logo)svg_logo = "".join(_maped_list)temp_svg_logo = re.findall("<svg.*</svg>", svg_logo, flags=re.IGNORECASE)svg_logo = temp_svg_logo[0]except:svg_logo = '<svg xmlns="http://www.w3.org/2000/svg" width="150px" height="1px" viewBox="0 0 150 1"></svg>'return svg_logodef render_svg(svg):b64 = base64.b64encode(svg.encode("utf-8")).decode("utf-8")html = (r"""<div align="center"><img src="data:image/svg+xml;base64,%s" alt="Techdocs Logo" style="width: 60em;"/></div>"""% b64)st.markdown(html, unsafe_allow_html=True)
4 unmodified lines56789101112131415161718194 unmodified lines@mainlayoutdef instructions():with open("frontend/content/installation.md", "r",encoding='utf-8') as f:instructions = f.read()with open("frontend/content/working.md", "r",encoding='utf-8') as f:working = f.read()st.markdown("### π :rainbow[Using Techdocs via the CLI]")st.info("Please use the CLI to generate the documentation for your project. The Streamlit app is just a demo to give the user an idea of the project.")with st.expander("βοΈ Installation and setup"):st.markdown(instructions)4 unmodified lines5678910111213141516171819204 unmodified lines@mainlayoutdef instructions():with open("frontend/content/installation.md", "r",encoding='utf-8') as f:instructions = f.read()with open("content/working.md", "r",encoding='utf-8') as f:working = f.read()st.markdown("### π :rainbow[Using Techdocs via the CLI]")st.info("Please use the CLI to generate the documentation for your project. The Streamlit app is just a demo to give the user an idea of the project.")with st.expander("βοΈ Installation and setup"):st.markdown(instructions)
frontend/components/__init__.py+2-1
frontend/components/login.py+1-2
frontend/components/logo.py+37-8
frontend/images/techdocslogo.svgAdded
frontend/pages/2_π_Instructions.py+3-2