routeros-scripts-main/contrib/html.sh
Christian Hesse 97b4a41f23 contrib/html: add empty lines...
... for easier rebasing.
2025-11-20 09:48:35 +01:00

11 lines
250 B
Bash
Executable file

#!/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>'