def zip(markdown_file: Path):
"""
Generate a ZIP file with the presentation.
"""
markdown_file = Path(markdown_file)
# We copy the directory because `make_archive` cannot follow symlinks...
with TemporaryDirectory() as tmpdir:
tmpdir = Path(tmpdir) / 'out'
generate(markdown_file)
config = load_config()
copytree(src=str(config['output_path']), dst=str(tmpdir))
make_archive(markdown_file.stem, format='zip', root_dir=str(tmpdir))
评论列表
文章目录