all: build/out.html
build/out.html: card.yaml build/card.xml build/style.xsl style.css
xsltproc \
-o build/out.html \
build/style.xsl \
build/card.xml
define TMP_PYTHON_PROG
from jinja2 import Environment, FileSystemLoader
with open("card.yaml") as f:
data = f.read()
out = Environment(
loader=FileSystemLoader('templates'))\
.get_template('card.xml.j2')\
.render(data=data)
#print(out)
with open("build/card.xml", "w") as f:
f.write(out)
endef
export TMP_PYTHON_PROG
build/card.xml:
python -c "$$TMP_PYTHON_PROG"
build/style.xsl: style.html.j2
cp style.html.j2 build/style.xsl
.PHONY: dev
dev:
git ls-files | entr make all
.PHONY: clean
clean:
rm build/* out.html