FIX: Path when outputing in a different directory.

This commit is contained in:
Julien Palard 2020-12-01 16:36:04 +01:00
parent 15d8bff66d
commit 1d7f3ff901
2 changed files with 4 additions and 3 deletions

View File

@ -254,7 +254,8 @@ def main():
tpl = jinja2.Template(TPL)
root = Path(args.html).resolve().parent
reveal_path = root / f"reveal.js-{REVEAL_JS_VERSION}"
reveal_dir = f"reveal.js-{REVEAL_JS_VERSION}"
reveal_path = root / reveal_dir
if not reveal_path.exists():
tarball = io.BytesIO(requests.get(REVEAL_ARCHIVE).content)
tarfile.open(fileobj=tarball, mode="r:gz").extractall(root)
@ -274,7 +275,7 @@ def main():
sections.append(slides)
with open(args.html, "w") as f:
f.write(tpl.render(slides=sections, revealjs_url=reveal_path))
f.write(tpl.render(slides=sections, revealjs_url=reveal_dir))
if __name__ == "__main__":

View File

@ -1,6 +1,6 @@
[metadata]
name = mdtoreveal
version = 0.2
version = 0.3
description = Transform a flat markdown to a reveal.js presentation.
long_description = file: README.md
long_description_content_type = text/markdown; charset=UTF-8