Update app.py
Browse files
app.py
CHANGED
@@ -76,11 +76,11 @@ def auto_save():
|
|
76 |
st.success(f"Auto-saved to {filename}")
|
77 |
|
78 |
def main():
|
|
|
79 |
|
80 |
-
col1, col2, col3 = st.columns([
|
81 |
|
82 |
with col1:
|
83 |
-
st.markdown('### 🎵 ChordSheet - Music Playing & Authoring')
|
84 |
with st.expander("Select Song:", expanded=True):
|
85 |
all_files = [f for f in glob.glob("*.txt") if ' by ' in f]
|
86 |
selected_file = st.selectbox("Choose: ", all_files, on_change=song_update, key='selected_file')
|
@@ -109,24 +109,17 @@ def main():
|
|
109 |
song_info = os.path.splitext(file)[0].replace("_", " ")
|
110 |
icol1, icol2 = st.columns([1, 3])
|
111 |
with icol1:
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
#st.markdown(f"**Song:** {song_info}")
|
116 |
-
st.markdown("**" + song_info + "**")
|
117 |
-
|
118 |
-
load_song_file(selected_file)
|
119 |
-
song_info = os.path.splitext(selected_file)[0].replace("_", " ")
|
120 |
-
|
121 |
with icol2:
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
st.markdown(table_md)
|
130 |
|
131 |
with col3:
|
132 |
chord_sheet_area = st.text_area("Chord Sheet", value=st.session_state.get('chord_sheet', ''), height=1200, key='chord_sheet', on_change=auto_save)
|
|
|
76 |
st.success(f"Auto-saved to {filename}")
|
77 |
|
78 |
def main():
|
79 |
+
st.markdown('### 🎵 ChordSheet - Music Playing and Authoring App')
|
80 |
|
81 |
+
col1, col2, col3 = st.columns([1, 3, 5])
|
82 |
|
83 |
with col1:
|
|
|
84 |
with st.expander("Select Song:", expanded=True):
|
85 |
all_files = [f for f in glob.glob("*.txt") if ' by ' in f]
|
86 |
selected_file = st.selectbox("Choose: ", all_files, on_change=song_update, key='selected_file')
|
|
|
109 |
song_info = os.path.splitext(file)[0].replace("_", " ")
|
110 |
icol1, icol2 = st.columns([1, 3])
|
111 |
with icol1:
|
112 |
+
st.markdown("**" + song_info + "**")
|
113 |
+
load_song_file(file)
|
114 |
+
song_info = os.path.splitext(file)[0].replace("_", " ")
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
with icol2:
|
116 |
+
# Create a markdown table with links for each song file
|
117 |
+
table_md = f"""
|
118 |
+
| Wikipedia | YouTube | Chords | Lyrics |
|
119 |
+
| --------- | ------- | ------ | ------ |
|
120 |
+
| [📚]({create_search_url_wikipedia(song_info)}) | [🎥]({create_search_url_youtube(song_info)}) | [🎸]({create_search_url_chords(song_info)}) | [🎶]({create_search_url_lyrics(song_info)}) |
|
121 |
+
"""
|
122 |
+
st.markdown(table_md)
|
|
|
123 |
|
124 |
with col3:
|
125 |
chord_sheet_area = st.text_area("Chord Sheet", value=st.session_state.get('chord_sheet', ''), height=1200, key='chord_sheet', on_change=auto_save)
|