slimshadow commited on
Commit
522f145
·
verified ·
1 Parent(s): bd820a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import streamlit as st
2
 
3
- # List of subjects and corresponding file paths
4
  subjects = {
5
  "Architecture": "architecture.md",
6
  "Data Structures": "DS.md",
@@ -9,13 +9,13 @@ subjects = {
9
  "C++": "cplusplus.md"
10
  }
11
 
12
- # Sidebar for subject selection
13
- st.sidebar.title("Syllabus")
14
- subject = st.sidebar.selectbox("Choose a subject:", list(subjects.keys()))
15
 
16
- # Read and display the selected subject's content
17
  with open(subjects[subject], "r") as file:
18
  syllabus_content = file.read()
19
 
20
- # Display the Markdown content in the sidebar
21
- st.sidebar.markdown(syllabus_content, unsafe_allow_html=True)
 
1
  import streamlit as st
2
 
3
+ # Define subjects and file paths
4
  subjects = {
5
  "Architecture": "architecture.md",
6
  "Data Structures": "DS.md",
 
9
  "C++": "cplusplus.md"
10
  }
11
 
12
+ # Display the navbar at the top
13
+ st.title("Course Syllabus")
14
+ subject = st.radio("Select a subject:", list(subjects.keys()), horizontal=True)
15
 
16
+ # Load and display content based on selection
17
  with open(subjects[subject], "r") as file:
18
  syllabus_content = file.read()
19
 
20
+ # Render the content
21
+ st.markdown(syllabus_content, unsafe_allow_html=True)