Update app.py
Browse files
app.py
CHANGED
|
@@ -453,8 +453,11 @@ def FileSidebar():
|
|
| 453 |
if st.button("📂", key=f"open_{file}"):
|
| 454 |
with open(file, "rb") as f:
|
| 455 |
content = f.read()
|
| 456 |
-
if ext
|
| 457 |
st.text_area(f"Editing {file}", value=content.decode("utf-8"), height=300, key=f"edit_{file}")
|
|
|
|
|
|
|
|
|
|
| 458 |
elif ext in [".png", ".jpg", ".jpeg"]:
|
| 459 |
st.image(content, use_column_width=True, caption=f"Viewing {file}")
|
| 460 |
elif ext in [".wav", ".mp3"]:
|
|
|
|
| 453 |
if st.button("📂", key=f"open_{file}"):
|
| 454 |
with open(file, "rb") as f:
|
| 455 |
content = f.read()
|
| 456 |
+
if ext == ".md":
|
| 457 |
st.text_area(f"Editing {file}", value=content.decode("utf-8"), height=300, key=f"edit_{file}")
|
| 458 |
+
elif ext == ".pdf":
|
| 459 |
+
st.download_button("Download PDF to Edit", content, file, "application/pdf")
|
| 460 |
+
st.write("PDF editing not supported in-app; download to edit externally.")
|
| 461 |
elif ext in [".png", ".jpg", ".jpeg"]:
|
| 462 |
st.image(content, use_column_width=True, caption=f"Viewing {file}")
|
| 463 |
elif ext in [".wav", ".mp3"]:
|