input_files := \
0-frontmatter.md \
2-licence.md \
3-definitions.md \
4-syntaxe.md \
5-editeurs.md \
6-advanced.md \
7-bibliographie.md \
100-references.md \

pandoc := \
	pandoc -s --citeproc \
	--css=style.css --template=template.html \
	--toc --toc-depth=2 \

pandoc_html := \
	$(pandoc) \
	--to=html --output=document.html \
	$(input_files)

pandoc_pdf := \
	$(pandoc) \
	-V noscript=true \
	--embed-resource --to=pdf \
	--pdf-engine=pagedjs-cli \
	--output=document.pdf \
	$(input_files)

html: $(input_files) 
	$(pandoc_html)

watch_html: $(input_files)
	watchexec -r -w . -i document.html \
	" $(pandoc_html)"

pdf: $(input_files)
	$(pandoc_pdf)

serve:
	watchexec -r -w . "python -m http.server"
