From 9b00ec17f2fd2d4aee1819fd85cd1f9a3ee51550 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Wed, 13 Jan 2021 22:50:32 +0000 Subject: Switch git.causal.agency to hilex and htagml Still missing a shell lexer in hilex, but well... it's shell. --- www/git.causal.agency/source-filter.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'www/git.causal.agency/source-filter.sh') diff --git a/www/git.causal.agency/source-filter.sh b/www/git.causal.agency/source-filter.sh index 4febc2e0..924744bd 100644 --- a/www/git.causal.agency/source-filter.sh +++ b/www/git.causal.agency/source-filter.sh @@ -1,3 +1,20 @@ #!/bin/sh +set -eu -exec /usr/local/libexec/hi -t -n "$1" -f html -o anchor +ctags=/usr/bin/ctags +hilex=/usr/local/libexec/hilex +htagml=/usr/local/libexec/htagml + +case "$1" in + (*.[chlmy]) + src=$(mktemp -t source-filter) + tag=$(mktemp -t source-filter) + trap 'rm -f "${src}" "${tag}"' EXIT + cat >"${src}" + $ctags -w -f "${tag}" "${src}" + $hilex -n "$1" -f html "${src}" | $htagml -i -f "${tag}" "${src}" + ;; + (*) + exec $hilex -t -n "$1" -f html + ;; +esac -- cgit 1.4.1