On Thursday, February 27th, 2025 at 9:47 AM, Ludovico Gerardi
Thanks, Ludivico.
I managed to get your script and macro to run. That's great.
I modified the Pandoc command to add a path to a directory where I save .epub files.
#!/usr/bin/env python3
import sys
import subprocess
article = ""
title = ""
for line in sys.stdin:
article = article + line
if not title and line.startswith("Title:"):
title = line[7:].strip()
subprocess.run(
["pandoc", "--metadata", f'title="{title}"', "-o", "/home/user/epub/" + title + ".epub"],
input=bytes(article, encoding="utf-8"),
)
Thanks again.
PS: on Google groups UI, indents of the script were removed, at least in the browser I use.
PS2: Pandoc produces an error when I use "~/epub"