output path

This commit is contained in:
Andrei Astafev 2019-04-26 12:54:47 +03:00
parent 40650a5839
commit ce1887a8df

View File

@ -41,8 +41,8 @@ def plantuml(key, value, format_, meta):
else:
latex_img_format = "eps"
os.makedirs("images", exist_ok=True)
filename = "images/" + hashlib.sha1(code.encode(sys.getfilesystemencoding())).hexdigest()
os.makedirs("output/images", exist_ok=True)
filename = "output/images/" + hashlib.sha1(code.encode(sys.getfilesystemencoding())).hexdigest()
filetype = get_extension(format_, "png", html="svg", latex=latex_img_format, beamer=latex_img_format)
src = filename + '.uml'
@ -55,7 +55,6 @@ def plantuml(key, value, format_, meta):
with open(src, "wb") as f:
f.write(txt)
subprocess.check_call(PLANTUML_BIN.split() + ["-t" + filetype, src])
sys.stderr.write('Created image ' + dest + '\n')
if (filetype == "latex") and (latex_img_format == 'latex'):
latex = open(dest).read()
return RawBlock('latex', latex.split("\\begin{document}")[-1].split("\\end{document}")[0])