Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -99,6 +99,10 @@ def turn_page(direction):
|
|
| 99 |
elif direction == "prev" and st.session_state.page_index > 0:
|
| 100 |
st.session_state.page_index -= 1
|
| 101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
# Display page turner controls
|
| 103 |
col1, col2, col3 = st.columns([1, 2, 1])
|
| 104 |
with col1:
|
|
@@ -109,7 +113,7 @@ with col2:
|
|
| 109 |
st.write(f"Page {st.session_state.page_index + 1} of {len(summ_text)}")
|
| 110 |
|
| 111 |
# Display editable text box
|
| 112 |
-
text = st.text_area("Edit Text", summ_text[st.session_state.page_index], height=200)
|
| 113 |
|
| 114 |
# Display HTML box
|
| 115 |
st.markdown(render_html(text), unsafe_allow_html=True)
|
|
|
|
| 99 |
elif direction == "prev" and st.session_state.page_index > 0:
|
| 100 |
st.session_state.page_index -= 1
|
| 101 |
|
| 102 |
+
def update_text():
|
| 103 |
+
st.session_state.current_text = st.session_state.text_area_value
|
| 104 |
+
|
| 105 |
+
|
| 106 |
# Display page turner controls
|
| 107 |
col1, col2, col3 = st.columns([1, 2, 1])
|
| 108 |
with col1:
|
|
|
|
| 113 |
st.write(f"Page {st.session_state.page_index + 1} of {len(summ_text)}")
|
| 114 |
|
| 115 |
# Display editable text box
|
| 116 |
+
text = st.text_area("Edit Text", summ_text[st.session_state.page_index], height=200, on_change=update_text)
|
| 117 |
|
| 118 |
# Display HTML box
|
| 119 |
st.markdown(render_html(text), unsafe_allow_html=True)
|