Spaces:
Runtime error
Runtime error
Commit
·
91e22c4
1
Parent(s):
b3b6b61
Update app.py
Browse files
app.py
CHANGED
@@ -184,31 +184,15 @@ def editor_page():
|
|
184 |
|
185 |
quill_text = st.session_state.output_text
|
186 |
edited_text = st_quill(quill_text)
|
187 |
-
|
188 |
st.write("Here is the edited obituary:")
|
189 |
#st.write(edited_text)
|
190 |
|
191 |
-
st.session_state.edited_text= edited_text
|
192 |
|
193 |
if st.button("Save as PDF"):
|
194 |
# Save the output text as a PDF
|
195 |
-
|
196 |
-
|
197 |
-
# Generate HTML code for the edited text with formatting
|
198 |
-
html_code = f"""
|
199 |
-
<html>
|
200 |
-
<head>
|
201 |
-
<style>
|
202 |
-
{edited_text['css']}
|
203 |
-
</style>
|
204 |
-
</head>
|
205 |
-
<body>
|
206 |
-
{edited_text['html']}
|
207 |
-
</body>
|
208 |
-
</html>
|
209 |
-
"""
|
210 |
-
|
211 |
-
save_as_pdf(html_code)
|
212 |
st.write("The custom obituary has been saved as a PDF.")
|
213 |
|
214 |
# Add some custom CSS to style the editor
|
@@ -227,9 +211,11 @@ def editor_page():
|
|
227 |
.ql-editor {
|
228 |
height: 100%;
|
229 |
}
|
|
|
230 |
</style>
|
231 |
""", unsafe_allow_html=True)
|
232 |
|
|
|
233 |
|
234 |
|
235 |
|
|
|
184 |
|
185 |
quill_text = st.session_state.output_text
|
186 |
edited_text = st_quill(quill_text)
|
187 |
+
|
188 |
st.write("Here is the edited obituary:")
|
189 |
#st.write(edited_text)
|
190 |
|
191 |
+
st.session_state.edited_text = edited_text
|
192 |
|
193 |
if st.button("Save as PDF"):
|
194 |
# Save the output text as a PDF
|
195 |
+
save_as_pdf(st.session_state.edited_text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
st.write("The custom obituary has been saved as a PDF.")
|
197 |
|
198 |
# Add some custom CSS to style the editor
|
|
|
211 |
.ql-editor {
|
212 |
height: 100%;
|
213 |
}
|
214 |
+
{edited_text.get('css')}
|
215 |
</style>
|
216 |
""", unsafe_allow_html=True)
|
217 |
|
218 |
+
|
219 |
|
220 |
|
221 |
|