aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/html.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/html.sh')
-rwxr-xr-xcontrib/html.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/html.sh b/contrib/html.sh
new file mode 100755
index 0000000..bbd8ba8
--- /dev/null
+++ b/contrib/html.sh
@@ -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>'