PDF export (fully automated with make target)

Generate tex files directly with python, not relying on lektor
This commit is contained in:
relikd
2020-11-16 15:27:21 +01:00
parent 07bb189da3
commit 39dc3a3575
10 changed files with 234 additions and 124 deletions

View File

@@ -1,4 +1,5 @@
PROJDIR := src
TEXER := lualatex
help:
@echo
@@ -11,7 +12,7 @@ help:
@echo ' server - Start lektor server with live change updates'
@echo ' build - Build deployable website into ./bin'
@echo ' deploy - Custom rsync command to sync ./bin to remote server'
@echo
@echo ' pdf - Generate PDF from tex (after build)'
@echo
@echo ' find-links - Search for cross reference between recipes'
@echo
@@ -42,15 +43,14 @@ clean-all: clean plugins
# Build
server:
@cd '$(PROJDIR)' && lektor server
@cd '$(PROJDIR)' && lektor server # -f ENABLE_PDF_EXPORT
build:
@cd '$(PROJDIR)' && \
lektor build --output-path ../bin --buildstate-path ../build-state -f ENABLE_APPCACHE
lektor build --output-path ../bin --buildstate-path ../build-state -f ENABLE_APPCACHE -f ENABLE_PDF_EXPORT
@echo
@echo 'Checking dead links ...'
@python3 extras/find-dead-links.py
@echo
deploy:
@echo
@@ -59,6 +59,24 @@ deploy:
@echo # --dry-run
rsync -rclzv --exclude=.lektor --exclude=.DS_Store --delete bin/ vps:/srv/http/recipe-lekture
pdf:
@echo
@echo 'Generating PDF from tex source ...'
@echo 'Check if $(TEXER) exists'
@which $(TEXER)
@cd extras/pdf-export/ && \
SECONDS=0; \
for i in 1 2; do \
for alt in de en; do \
fname="pdf-$${alt}.tex"; \
echo "$$ $(TEXER) $${fname} [$${i}]"; \
$(TEXER) $${fname} > /dev/null; \
done; \
done; \
echo "done. finished after $${SECONDS}s."
rm -rf extras/pdf-export/*.{aux,log,out,toc}
mv extras/pdf-export/pdf-*.pdf bin/static
# Helper methods on all recipes
find-links: