export MERMAID_FILTER_FORMAT:=pdf

all: local

help:
	@echo "Please choose an option!"
	@echo "- Create pdf: make pdf"

dir:
	mkdir -p out

tmp:
	cat $$(find chapters -type f -name "*.md" | sort) | grep -vw '<!-- prettier-ignore -->' > /tmp/bachelor-build


bachelor: @cat $(MARKDOWN_FILES)

local: dir tmp
	@echo "Building paper"
	pandoc -f markdown+implicit_figures --strip-comments --listings -V colorlinks=true -V linkcolor=black -V urlcolor=black -f 'markdown+autolink_bare_uris' --pdf-engine=lualatex --pdf-engine-opt=-shell-escape --filter mermaid-filter --filter py-pandoc-include-code --lua-filter columns.lua --citeproc -s /tmp/bachelor-build -o ./out/bachelor.pdf -V lang=de-DE -V fontsize=12pt --reference-links --bibliography Bachelor.bib --csl=harvard-right.csl -M lang:de --number-sections -Vindent=false

clean:
	rm -rf out
