Atualizar src-py/renatoxsr/utils/pandoc.py
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user