awacke1 commited on
Commit
dc899fe
Β·
1 Parent(s): e60f1e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -216,7 +216,7 @@ def main():
216
  file_contents=''
217
  next_action=''
218
  for file in all_files:
219
- col1, col2, col3, col4 = st.sidebar.columns([5,1,1,1]) # adjust the ratio as needed
220
  with col1:
221
  st.markdown(get_table_download_link(file), unsafe_allow_html=True)
222
  with col2:
@@ -230,6 +230,11 @@ def main():
230
  file_contents = f.read()
231
  next_action='open'
232
  with col4:
 
 
 
 
 
233
  if st.button("πŸ—‘", key="delete_"+file):
234
  os.remove(file)
235
  st.experimental_rerun()
@@ -237,6 +242,8 @@ def main():
237
  if len(file_contents) > 0:
238
  if next_action=='open':
239
  file_content_area = st.text_area("File Contents:", file_contents, height=500)
 
 
240
  if next_action=='search':
241
  file_content_area = st.text_area("File Contents:", file_contents, height=500)
242
  st.write('Reasoning with your inputs...')
 
216
  file_contents=''
217
  next_action=''
218
  for file in all_files:
219
+ col1, col2, col3, col4, col5 = st.sidebar.columns([6,1,1,1,1]) # adjust the ratio as needed
220
  with col1:
221
  st.markdown(get_table_download_link(file), unsafe_allow_html=True)
222
  with col2:
 
230
  file_contents = f.read()
231
  next_action='open'
232
  with col4:
233
+ if st.button("🌐", key="md_"+file): # md emoji button
234
+ with open(file, 'r') as f:
235
+ file_contents = f.read()
236
+ next_action='md'
237
+ with col5:
238
  if st.button("πŸ—‘", key="delete_"+file):
239
  os.remove(file)
240
  st.experimental_rerun()
 
242
  if len(file_contents) > 0:
243
  if next_action=='open':
244
  file_content_area = st.text_area("File Contents:", file_contents, height=500)
245
+ if next_action=='md':
246
+ st.markdown(file_contents)
247
  if next_action=='search':
248
  file_content_area = st.text_area("File Contents:", file_contents, height=500)
249
  st.write('Reasoning with your inputs...')