summary refs log tree commit diff
path: root/www/git.causal.agency/about-filter.sh
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-18 23:37:45 -0500
committerJune McEnroe <june@causal.agency>2019-12-18 23:39:54 -0500
commitb6ff1659e5cb70a3b3a9d7ecb0c87683a54baa7d (patch)
treea2d77302fc4206d8dd7508e0f38a2d223c262a28 /www/git.causal.agency/about-filter.sh
parentCustomize cgit CSS (diff)
downloadsrc-b6ff1659e5cb70a3b3a9d7ecb0c87683a54baa7d.tar.gz
src-b6ff1659e5cb70a3b3a9d7ecb0c87683a54baa7d.zip
Hide line numbers when rendering mdoc
Hack: output an extra <td> after rendering mdoc so that line numbers can
be hidden based on there being three. This required splitting
source-filter and about-filter since on about pages there is no table.
Diffstat (limited to 'www/git.causal.agency/about-filter.sh')
-rw-r--r--www/git.causal.agency/about-filter.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/www/git.causal.agency/about-filter.sh b/www/git.causal.agency/about-filter.sh
new file mode 100644
index 00000000..216c86e9
--- /dev/null
+++ b/www/git.causal.agency/about-filter.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+case "$1" in
+	(*.[1-9])
+		/usr/bin/mandoc -T utf8 \
+			| /usr/local/libexec/ttpre \
+			| /usr/bin/sed -E \
+				's,([a-z0-9_-]+)[(]([1-9])[)],<a href="\1.\2">&</a>,g'
+		;;
+	(*)
+		exec /usr/local/libexec/hi -l text -f html
+		;;
+esac