diff --git a/booklet/booklet.py b/booklet/booklet.py index 118e136..24dc14d 100644 --- a/booklet/booklet.py +++ b/booklet/booklet.py @@ -1,6 +1,7 @@ from glob import glob import os import subprocess +import jinja2 # https://devdocs.io/python~3.9/library/glob#glob.glob # files = glob("content/**", recursive=True) @@ -53,7 +54,13 @@ output.write(all_md) output.close() pandoc_md = "pandoc -s --toc -c style.css -f markdown -t html booklet.md -o booklet.html" os.system(pandoc_md) -print("booklet html files saved!") +print("booklet html files saved!") + +html=[] + +env = jinja2.Environment(loader=jinja2.FileSystemLoader(".")) +template = env.get_template("booklet.template.html") +booklet_html = template.render(content=html) #take all the css files and write to main css diff --git a/booklet/booklet.template.html b/booklet/booklet.template.html index b515324..291502c 100644 --- a/booklet/booklet.template.html +++ b/booklet/booklet.template.html @@ -1,22 +1,13 @@ - - + + + - $title$ - + - + - - -

$title$

- -$if(toc)$ -
$table-of-contents$
-$endif$ - -
$body$
- +
{{ content }}
- + \ No newline at end of file