generate valid HTML, including head & style

This commit is contained in:
Christian Hesse 2025-09-16 12:01:32 +02:00
parent 2c715096b9
commit 14b51d96b0
3 changed files with 26 additions and 2 deletions

9
contrib/html.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
set -e
sed "s|__TITLE__|$(head -n1 "${1}")|" < "${0}.d/head.html"
markdown -f toc,idanchor "${1}" | sed \
-e 's/href="\([-_\./[:alnum:]]*\)\.md"/href="\1.html"/g' \
-e '/<h[1234] /s| id="\(.*\)">| id="\L\1">|'
printf '</body></html>'