summary refs log tree commit diff
path: root/www/git.causal.agency/source-filter.sh
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-18 21:40:50 -0500
committerJune McEnroe <june@causal.agency>2019-12-18 21:40:50 -0500
commit480a5024344b5e5b3562c3d663206fc372235510 (patch)
treeeb8223bc6877988d26fb9d42f3246271d867f797 /www/git.causal.agency/source-filter.sh
parentBail from hi if input is binary (diff)
downloadsrc-480a5024344b5e5b3562c3d663206fc372235510.tar.gz
src-480a5024344b5e5b3562c3d663206fc372235510.zip
Add git.causal.agency cgit config
Diffstat (limited to '')
-rw-r--r--www/git.causal.agency/source-filter.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/www/git.causal.agency/source-filter.sh b/www/git.causal.agency/source-filter.sh
new file mode 100644
index 00000000..ce9e3f8b
--- /dev/null
+++ b/www/git.causal.agency/source-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 -t -n "$1" -f html -o anchor
+		;;
+esac