summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--bin/Makefile14
-rw-r--r--bin/html.sh24
2 files changed, 23 insertions, 15 deletions
diff --git a/bin/Makefile b/bin/Makefile
index 5820051c..8e0cb324 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -134,22 +134,22 @@ htmltags: *.[chly]
 .SUFFIXES: .html
 
 .c.html:
-	sh html.sh $< man1/${<:.c=.1} > $@
+	sh html.sh man1/${<:.c=.1} $< > $@
 
 .h.html:
-	sh html.sh $< man3/${<:.h=.3} > $@
+	sh html.sh man3/${<:.h=.3} $< > $@
 
 .y.html:
-	sh html.sh $< man1/${<:.y=.1} > $@
+	sh html.sh man1/${<:.y=.1} $< > $@
 
 .sh.html:
-	sh html.sh $< man1/${<:.sh=.1} > $@
+	sh html.sh man1/${<:.sh=.1} $< > $@
 
 .pl.html:
-	sh html.sh $< man1/${<:.pl=.1} > $@
+	sh html.sh man1/${<:.pl=.1} $< > $@
 
-index.html: Makefile README.7
-	sh html.sh Makefile README.7 > $@
+index.html: README.7 Makefile html.sh
+	sh html.sh README.7 Makefile html.sh > $@
 
 install-html: ${HTMLS}
 	install -d ${WEBROOT}/bin
diff --git a/bin/html.sh b/bin/html.sh
index 600d37f5..5b59003f 100644
--- a/bin/html.sh
+++ b/bin/html.sh
@@ -3,12 +3,15 @@ set -eu
 
 readonly GitURL='https://git.causal.agency/src/tree/bin'
 
-src=$1
-man=${2:-}
+man=$1
+shift
+
+title=${man##*/}
+title=${title%.[1-9]}
 
 cat <<EOF
 <!DOCTYPE html>
-<title>${src}</title>
+<title>${title}</title>
 <style>
 $(./scheme -s)
 
@@ -59,8 +62,13 @@ EOF
 opts='fragment'
 [ "${man}" = "README.7" ] && opts="${opts},man=%N.html"
 mandoc -T html -O "${opts}" "${man}"
-cat <<EOF
-<p>
-<a href="${GitURL}/${src}">${src} in git</a>
-EOF
-./htagml -p -f htmltags "${src}"
+
+while [ $# -gt 0 ]; do
+	src=$1
+	shift
+	cat <<-EOF
+	<p>
+	<a href="${GitURL}/${src}">${src} in git</a>
+	EOF
+	./htagml -p -f htmltags "${src}"
+done