generate valid HTML, including head & style

This commit is contained in:
Christian Hesse 2025-09-16 12:01:32 +02:00
parent 6b0c9ab17d
commit 7a790b88c0
2 changed files with 20 additions and 2 deletions

View file

@ -11,8 +11,10 @@ HTML = $(MARKDOWN:.md=.html)
all: $(CAPSMAN) $(LOCAL) $(WIFI) $(HTML) checksums.json
%.html: %.md Makefile
markdown $< | sed 's/href="\([-_\./[:alnum:]]*\)\.md"/href="\1.html"/g' > $@
%.html: %.md contrib/head.html Makefile
sed 's|__TITLE__|$(shell head -n1 $<)|' < contrib/head.html > $@
markdown -f toc,idanchor $< | sed -e 's/href="\([-_\./[:alnum:]]*\)\.md"/href="\1.html"/g' -e '/<h[1234] /s| id="\(.*\)">| id="\L\1">|' >> $@
printf '</body></html>' >> $@
%.capsman.rsc: %.template.rsc Makefile
sed -e '/\/interface\/wifi\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.capsman|' \