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

10 lines
261 B
Python
Raw Normal View History

2017-03-27 09:17:49 +01:00
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