Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -111,7 +111,7 @@ def text2ppt(token_key, input_prompt, input_theme):
|
|
111 |
f.write(data)
|
112 |
f.close()
|
113 |
|
114 |
-
subprocess.run(["./pandoc-2.14.2/bin/pandoc", "text2ppt_test.md", "-t", "
|
115 |
print(os.listdir(os.getcwd()))
|
116 |
# subprocess.run(
|
117 |
# f"npx @marp-team/marp-cli@latest --pdf-fonts-dir=/usr/share/fonts/truetype/nanum --pdf-default-font=NanumGothic -o output.pdf text2ppt_test.md --chrome-path=/usr/bin/google-chrome-stable",
|
@@ -206,14 +206,15 @@ with tab1:
|
|
206 |
st.markdown(contents)
|
207 |
|
208 |
# ํ
์คํธ
|
209 |
-
subprocess.run(["./pandoc-2.14.2/bin/pandoc", "text2ppt_test.md", "-t", "
|
210 |
print(os.listdir(os.getcwd()))
|
211 |
-
|
212 |
-
|
|
|
213 |
st.download_button(label="Download PPT",
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
|
218 |
with tab2:
|
219 |
st.header('Text2PPT')
|
|
|
111 |
f.write(data)
|
112 |
f.close()
|
113 |
|
114 |
+
subprocess.run(["./pandoc-2.14.2/bin/pandoc", "text2ppt_test.md", "-t", "pptx", "-o", "output.pptx"], capture_output=True)
|
115 |
print(os.listdir(os.getcwd()))
|
116 |
# subprocess.run(
|
117 |
# f"npx @marp-team/marp-cli@latest --pdf-fonts-dir=/usr/share/fonts/truetype/nanum --pdf-default-font=NanumGothic -o output.pdf text2ppt_test.md --chrome-path=/usr/bin/google-chrome-stable",
|
|
|
206 |
st.markdown(contents)
|
207 |
|
208 |
# ํ
์คํธ
|
209 |
+
subprocess.run(["./pandoc-2.14.2/bin/pandoc", "text2ppt_test.md", "-t", "pptx", "-o", "output.pptx"], capture_output=True)
|
210 |
print(os.listdir(os.getcwd()))
|
211 |
+
prs = Presentation("output.pptx")
|
212 |
+
binary_output = BytesIO()
|
213 |
+
prs.save(binary_output)
|
214 |
st.download_button(label="Download PPT",
|
215 |
+
data = binary_output.getvalue(),
|
216 |
+
file_name="export_output.pptx",
|
217 |
+
mime='application/octet-stream', key = "<Text2PPT_download>")
|
218 |
|
219 |
with tab2:
|
220 |
st.header('Text2PPT')
|