aboutsummaryrefslogtreecommitdiff
path: root/docs/makefile
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-11-19 12:38:09 +0100
committerlonkaars <loek@pipeframe.xyz>2022-11-19 12:38:09 +0100
commit0db6d0616bd4a9730b68e22f29fc76232981cc88 (patch)
treeb2c058139508f90a1e3126249dcdcb9629961696 /docs/makefile
parente47b1ddefa9989594bb81bd872b88c085cd777bc (diff)
more WIP doc generation
Diffstat (limited to 'docs/makefile')
-rw-r--r--docs/makefile15
1 files changed, 7 insertions, 8 deletions
diff --git a/docs/makefile b/docs/makefile
index 843716a..b5917af 100644
--- a/docs/makefile
+++ b/docs/makefile
@@ -1,5 +1,4 @@
PANDOC = pandoc
-CAT = cat
M4 = m4
RM = rm -f
CHROME = chromium
@@ -10,24 +9,24 @@ SRCS = $(wildcard *.md)
HTML_T = $(patsubst %.md,%.html, $(SRCS))
PDF_T = $(patsubst %.md,%.pdf, $(SRCS))
-.PRECIOUS: %.toc
+.PRECIOUS: %.toc %.con
all: $(HTML_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 $< > $@
-
-%.html: %.md %.toc gen/start.html gen/paged.polyfill.js
- $(PANDOC) $< --to=html | $(CAT) gen/start.html $(word 2,$^) - gen/end.html > $@
+%.con: %.md
+ $(PANDOC) $< --to=html > $@
%.toc: %.md
$(PANDOC) $< -s --toc --to=html 2> /dev/null | $(PUP) '#TOC' | sed -r 's/<(.?)ul>/<\1ol>/g' > $@
+%.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
clean:
- $(RM) $(HTML_T) $(PDF_T) gen/start.html gen/paged.polyfill.js
+ $(RM) $(HTML_T) $(PDF_T) *.toc *.con gen/paged.polyfill.js