diff --git a/Makefile b/Makefile index 89517410..fc38d678 100644 --- a/Makefile +++ b/Makefile @@ -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 '/| id="\L\1">|' >> $@ + printf '' >> $@ %.capsman.rsc: %.template.rsc Makefile sed -e '/\/interface\/wifi\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.capsman|' \ diff --git a/contrib/head.html b/contrib/head.html new file mode 100644 index 00000000..851b9fa6 --- /dev/null +++ b/contrib/head.html @@ -0,0 +1,16 @@ + +RouterOS Scripts :: __TITLE__ + + + +