annikwag commited on
Commit
8598201
·
verified ·
1 Parent(s): 3922556

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -377,7 +377,7 @@ else:
377
  preview_word_count = 90
378
  preview_text = " ".join(words[:preview_word_count])
379
  remainder_text = " ".join(words[preview_word_count:])
380
- # Create two columns: left for full description and right for additional details.
381
  col_left, col_right = st.columns(2)
382
  with col_left:
383
  st.markdown(highlight_query(preview_text, var), unsafe_allow_html=True)
@@ -448,12 +448,13 @@ else:
448
  preview_word_count = 90
449
  preview_text = " ".join(words[:preview_word_count])
450
  remainder_text = " ".join(words[preview_word_count:])
451
- # Create two columns: left for full description (preview + remainder) and right for additional details.
452
  col_left, col_right = st.columns(2)
453
  with col_left:
454
- # Combine preview and remainder into one text block.
455
- full_description = preview_text + (" " + remainder_text if remainder_text else "")
456
- st.markdown(full_description)
 
457
  with col_right:
458
  start_year = metadata.get('start_year', None)
459
  end_year = metadata.get('end_year', None)
 
377
  preview_word_count = 90
378
  preview_text = " ".join(words[:preview_word_count])
379
  remainder_text = " ".join(words[preview_word_count:])
380
+ # Create two columns: left for description, right for additional details.
381
  col_left, col_right = st.columns(2)
382
  with col_left:
383
  st.markdown(highlight_query(preview_text, var), unsafe_allow_html=True)
 
448
  preview_word_count = 90
449
  preview_text = " ".join(words[:preview_word_count])
450
  remainder_text = " ".join(words[preview_word_count:])
451
+ # Create two columns: left for full description (with expander) and right for additional details.
452
  col_left, col_right = st.columns(2)
453
  with col_left:
454
+ st.markdown(highlight_query(preview_text, var), unsafe_allow_html=True)
455
+ if remainder_text:
456
+ with st.expander("Show more"):
457
+ st.markdown(highlight_query(remainder_text, var), unsafe_allow_html=True)
458
  with col_right:
459
  start_year = metadata.get('start_year', None)
460
  end_year = metadata.get('end_year', None)