diff options
author | June McEnroe <june@causal.agency> | 2021-01-13 22:50:32 +0000 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-01-13 22:50:32 +0000 |
commit | 9b00ec17f2fd2d4aee1819fd85cd1f9a3ee51550 (patch) | |
tree | d150d21355d82290ca1427fa5aad0178821a1b62 /www/git.causal.agency/source-filter.sh | |
parent | Try to return make substitutions as single tokens (diff) | |
download | src-9b00ec17f2fd2d4aee1819fd85cd1f9a3ee51550.tar.gz src-9b00ec17f2fd2d4aee1819fd85cd1f9a3ee51550.zip |
Switch git.causal.agency to hilex and htagml
Still missing a shell lexer in hilex, but well... it's shell.
Diffstat (limited to '')
-rw-r--r-- | www/git.causal.agency/source-filter.sh | 19 |
1 files changed, 18 insertions, 1 deletions
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 |