Atualizar src-py/renatoxsr/utils/pandoc.py

This commit is contained in:
2026-09-26 15:19:09 -03:00
parent 1918465ada
commit a481bb68fe
+4 -1
View File
@@ -15,6 +15,7 @@ def pandoc(
bin: str | Path = "pandoc",
output: str | Path = "-",
overwrite = False,
to="markdown",
) -> str:
logger.info("%s: from '%s' to '%s'", bin, input_file, output)
if not Path(bin).is_file():
@@ -29,7 +30,9 @@ def pandoc(
outf = Path(output)
if output != "-" and outf.is_file() and not overwrite:
raise FileExistsError(errno.EEXIST, os.strerror(errno.EEXIST), outf)
cmd = [bin, "--output", "-" if output=="-" else outf.resolve(), fpath]
cmd = [bin,
"--output", "-" if output=="-" else outf.resolve(),
"--writer", to, fpath]
logger.debug("CMD %s", str(cmd))
proc = subprocess.run(cmd, text=True)