Individually cached tex and pdf files

This commit is contained in:
joachimschmidt557 2019-07-25 17:43:33 +02:00
parent e0f58caa71
commit 27f631cc2b

View file

@ -19,14 +19,14 @@ when isMainModule:
let let
pad = @"pad" pad = @"pad"
content = getContent(pad, etherpadUrl) content = getContent(pad, etherpadUrl)
texFile = open("etherpad.tex", fmWrite) texFile = open(pad & ".tex", fmWrite)
texFile.write(content) texFile.write(content)
texFile.close() texFile.close()
let (output, exitCode) = execCmdEx(quoteShellCommand(["pdflatex", "-halt-on-error", "etherpad.tex"])) let (output, exitCode) = execCmdEx(quoteShellCommand(["pdflatex", "-halt-on-error", pad & ".tex"]))
if exitCode == 0: if exitCode == 0:
resp(Http200, readFile("etherpad.pdf"), contentType = "application/pdf") resp(Http200, readFile(pad & ".pdf"), contentType = "application/pdf")
else: else:
resp output resp output