aboutsummaryrefslogtreecommitdiff
path: root/docs/makefile
diff options
context:
space:
mode:
authorNielsCoding <n.stunnebrink@student.avans.nl>2022-11-19 18:49:05 +0100
committerNielsCoding <n.stunnebrink@student.avans.nl>2022-11-19 18:49:05 +0100
commite8ed815597c29e4206a6bae120575e2963c80837 (patch)
tree85517752e8cc580c1f1e0095934ef24ebaa64ed3 /docs/makefile
parentd51b56c2803cc755cd099a8f2cfef7acdcb30cfa (diff)
parent27ef32dd82d69d2c8cdcae96cab713696399a281 (diff)
Merge branch 'master' of https://github.com/lonkaars/avans-domotica
Diffstat (limited to 'docs/makefile')
-rw-r--r--docs/makefile27
1 files changed, 16 insertions, 11 deletions
diff --git a/docs/makefile b/docs/makefile
index 9a994e4..78a931a 100644
--- a/docs/makefile
+++ b/docs/makefile
@@ -1,27 +1,32 @@
PANDOC = pandoc
-CAT = cat
M4 = m4
RM = rm -f
-CHROME = chromium
+CHROME = chromium --headless --run-all-compositor-stages-before-draw --virtual-time-budget=10000 --print-to-pdf-no-header
CURL = curl
+PUP = pup
SRCS = $(wildcard *.md)
-HTML_T = $(patsubst %.md,%.html, $(SRCS))
-PDF_T = $(patsubst %.md,%.pdf, $(SRCS))
+HTML_T = $(SRCS:.md=.html)
+PDF_T = $(SRCS:.md=.pdf)
-all: $(HTML_T)
+.PRECIOUS: %.toc %.con
+
+all: $(PDF_T)
gen/paged.polyfill.js:
$(CURL) -Ls https://unpkg.com/pagedjs/dist/paged.polyfill.js > $@
-gen/start.html: gen/start.m4 gen/style.css
- $(M4) -I gen $< > $@
+%.con: %.md
+ $(PANDOC) $< --to=html > $@
+
+%.toc: %.md
+ $(PANDOC) $< -s --toc --to=html 2> /dev/null | $(PUP) '#TOC' | sed -r 's/<(.?)ul>/<\1ol>/g' > $@
-%.html: %.md gen/start.html gen/paged.polyfill.js
- $(PANDOC) $< --to=html | $(CAT) gen/start.html - gen/end.html > $@
+%.html: %.con %.toc gen/doc.m4 gen/paged.polyfill.js gen/style.css
+ $(M4) -DNAME=$(basename $<) gen/doc.m4 > $@
%.pdf: %.html
- $(CHROME) --headless --print-to-pdf=$@ $< 2> /dev/null
+ $(CHROME) --print-to-pdf=$@ $< 2> /dev/null
clean:
- $(RM) $(HTML_T) $(PDF_T) gen/start.html gen/paged.polyfill.js
+ $(RM) $(HTML_T) $(PDF_T) *.toc *.con gen/paged.polyfill.js