jinja enters the stage

main
mb 2 years ago
parent 1e1eed56c1
commit 01a4d22c84

@ -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)
@ -55,6 +56,12 @@ pandoc_md = "pandoc -s --toc -c style.css -f markdown -t html booklet.md -o book
os.system(pandoc_md)
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

@ -1,22 +1,13 @@
<!DOCTYPE html>
<html lang="$language$">
<DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<title>$title$</title>
<script src="paged.js/paged.polyfill.js" type="text/javascript"></script>
<script src="paged.js/paged.polyfill.js"></script>
<link href="paged.js/pagedjs.css" rel="stylesheet" type="text/css">
<link href="print.css" rel="stylesheet" type="text/css" media="print">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
<h1 id="title">$title$</h1>
$if(toc)$
<section id="toc" role="doc-toc">$table-of-contents$</section>
$endif$
<div id="container">$body$</div>
<div id="content">{{ content }}</div>
</body>
</html>
Loading…
Cancel
Save