FIX: Path when outputing in a different directory.
This commit is contained in:
parent
15d8bff66d
commit
1d7f3ff901
|
@ -254,7 +254,8 @@ def main():
|
||||||
tpl = jinja2.Template(TPL)
|
tpl = jinja2.Template(TPL)
|
||||||
|
|
||||||
root = Path(args.html).resolve().parent
|
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():
|
if not reveal_path.exists():
|
||||||
tarball = io.BytesIO(requests.get(REVEAL_ARCHIVE).content)
|
tarball = io.BytesIO(requests.get(REVEAL_ARCHIVE).content)
|
||||||
tarfile.open(fileobj=tarball, mode="r:gz").extractall(root)
|
tarfile.open(fileobj=tarball, mode="r:gz").extractall(root)
|
||||||
|
@ -274,7 +275,7 @@ def main():
|
||||||
sections.append(slides)
|
sections.append(slides)
|
||||||
|
|
||||||
with open(args.html, "w") as f:
|
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__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[metadata]
|
[metadata]
|
||||||
name = mdtoreveal
|
name = mdtoreveal
|
||||||
version = 0.2
|
version = 0.3
|
||||||
description = Transform a flat markdown to a reveal.js presentation.
|
description = Transform a flat markdown to a reveal.js presentation.
|
||||||
long_description = file: README.md
|
long_description = file: README.md
|
||||||
long_description_content_type = text/markdown; charset=UTF-8
|
long_description_content_type = text/markdown; charset=UTF-8
|
||||||
|
|
Loading…
Reference in New Issue
Block a user