summary refs log tree commit diff
path: root/www/git.causal.agency/source-filter.sh
blob: ce9e3f8b30ad68f4dcf46942cda9bcde1978ee71 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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