diff options
Diffstat (limited to 'render.py')
| -rw-r--r-- | render.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/render.py b/render.py new file mode 100644 index 0000000..5a5dd89 --- /dev/null +++ b/render.py @@ -0,0 +1,10 @@ +from jinja2 import FileSystemLoader, Environment +import sys +from codecs import open + +env = Environment(loader=FileSystemLoader("./")) +template = env.get_template("theme/layout.html") +contents = open("clean/contents.html", encoding="utf8").read() +with open(sys.argv[2], "w", encoding="utf8") as f: + f.write(template.render(chapter=open(sys.argv[1], encoding="utf8").read(), + contents=contents)) |
