Spaces:
Running
on
Zero
Running
on
Zero
Liam Dyer
commited on
initial
Browse files- app.py +17 -0
- packages.txt +1 -0
- requirements.txt +1 -0
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def convert(file):
|
| 6 |
+
os.system(f"pandoc {file} -t markdown -o output.md")
|
| 7 |
+
with open("output.md", "r") as f:
|
| 8 |
+
return f.read()
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
gr.Interface(
|
| 12 |
+
fn=convert,
|
| 13 |
+
inputs=[
|
| 14 |
+
gr.File(label="Upload File", type="filepath"),
|
| 15 |
+
],
|
| 16 |
+
outputs=[gr.Text(label="Markdown")],
|
| 17 |
+
).launch()
|
packages.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pandoc
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pandoc==2.3
|