Spaces:
Running
on
Zero
Running
on
Zero
Liam Dyer
commited on
fix: pandoc
Browse files
app.py
CHANGED
|
@@ -60,7 +60,11 @@ def extract_metadata_from_pdf(reader):
|
|
| 60 |
def convert_pandoc(input_file):
|
| 61 |
# Convert the file to markdown with pandoc
|
| 62 |
output_file = f"{random_word(16)}.md"
|
| 63 |
-
result = subprocess.call(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
# Read the file and delete
|
| 66 |
with open(output_file, "r") as f:
|
|
|
|
| 60 |
def convert_pandoc(input_file):
|
| 61 |
# Convert the file to markdown with pandoc
|
| 62 |
output_file = f"{random_word(16)}.md"
|
| 63 |
+
result = subprocess.call(
|
| 64 |
+
["pandoc", input_file, "-t", "markdown", "-o", output_file]
|
| 65 |
+
)
|
| 66 |
+
if result != 0:
|
| 67 |
+
raise ValueError("Error converting file to markdown with pandoc")
|
| 68 |
|
| 69 |
# Read the file and delete
|
| 70 |
with open(output_file, "r") as f:
|