mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-12-06 09:59:28 +00:00
15 lines
467 B
Bash
Executable file
15 lines
467 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
RELTO="$(dirname "${1}")"
|
|
sed \
|
|
-e "s|__TITLE__|$(head -n1 "${1}")|" \
|
|
-e "s|__STYLE__|$(realpath --relative-to="${RELTO}" style.css)|" \
|
|
-e "s|__LOGO__|$(realpath --relative-to="${RELTO}" logo.png)|" \
|
|
< "${0}.d/head.html"
|
|
markdown -f toc,idanchor "${1}" | sed \
|
|
-e 's/href="\([-_\./[:alnum:]]*\)\.md\(#[-[:alnum:]]*\)\?"/href="\1.html\2"/g' \
|
|
-e '/<h[1234] /s| id="\(.*\)">| id="\L\1">|' \
|
|
-e '/<h[1234] /s|-2c-||'
|
|
printf '</body></html>'
|