This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
md-pdf/md_pdf/build/cover.py
2017-03-27 09:26:54 +01:00

9 lines
261 B
Python

from jinja2 import Template
def render_cover(context):
with open("cover-template.html") as f:
template = Template(f.read())
with open("cover.html", "w") as f:
cover = template.render(context)
f.write(cover)
return cover