summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-01-12 18:19:21 -0500
committerJune McEnroe <june@causal.agency>2021-01-12 18:19:21 -0500
commit5e42ec32b98e3f6e19ce10c11cf7c6b85cd48a3a (patch)
tree08f1fddee0906d83c3860d2f23a9e70ec6ab6b77 /bin
parentAdd htagml example (diff)
downloadsrc-5e42ec32b98e3f6e19ce10c11cf7c6b85cd48a3a.tar.gz
src-5e42ec32b98e3f6e19ce10c11cf7c6b85cd48a3a.zip
List both Makefile and html.sh under README.7
Diffstat (limited to '')
-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