diff options
author | June McEnroe <june@causal.agency> | 2021-01-20 03:49:40 +0000 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-01-20 03:49:40 +0000 |
commit | 5be0d7f6ec83dd09837f5da2617178136954c90d (patch) | |
tree | 918ec56452441f5d34a6a5d36da9848bff2d9c5a /www | |
parent | Add mtags to generate tags for make and mdoc (diff) | |
download | src-5be0d7f6ec83dd09837f5da2617178136954c90d.tar.gz src-5be0d7f6ec83dd09837f5da2617178136954c90d.zip |
Use mtags in source-filter
Diffstat (limited to '')
-rw-r--r-- | www/git.causal.agency/.gitignore | 1 | ||||
-rw-r--r-- | www/git.causal.agency/Makefile | 4 | ||||
-rw-r--r-- | www/git.causal.agency/source-filter.sh | 8 |
3 files changed, 9 insertions, 4 deletions
diff --git a/www/git.causal.agency/.gitignore b/www/git.causal.agency/.gitignore index 4f4682af..db5a9275 100644 --- a/www/git.causal.agency/.gitignore +++ b/www/git.causal.agency/.gitignore @@ -1,4 +1,5 @@ about-filter hilex htagml +mtags source-filter diff --git a/www/git.causal.agency/Makefile b/www/git.causal.agency/Makefile index 0509975f..6fdbf129 100644 --- a/www/git.causal.agency/Makefile +++ b/www/git.causal.agency/Makefile @@ -3,14 +3,14 @@ WWW = /usr/local/www/cgit LIBEXEC = /usr/local/libexec BIN = ../../bin -BINS = about-filter source-filter hilex htagml +BINS = about-filter source-filter hilex htagml mtags install: cgitrc custom.css ${BINS} install -m 644 cgitrc ${ETC} install -m 644 custom.css ${WWW} install ${BINS} ${LIBEXEC} -hilex htagml:: +hilex htagml mtags:: ${MAKE} -C ${BIN} $@ ln -f ${BIN}/$@ $@ diff --git a/www/git.causal.agency/source-filter.sh b/www/git.causal.agency/source-filter.sh index be04e0c1..87875bd1 100644 --- a/www/git.causal.agency/source-filter.sh +++ b/www/git.causal.agency/source-filter.sh @@ -2,17 +2,21 @@ set -eu ctags=/usr/bin/ctags +mtags=/usr/local/libexec/mtags hilex=/usr/local/libexec/hilex htagml=/usr/local/libexec/htagml case "$1" in - (*.[chlmy]) + (*.[chlmy]|Makefile|*.mk|*.[1-9]) tmp=$(mktemp -d -t source-filter) trap 'rm -fr "${tmp}"' EXIT cd "${tmp}" cat >"$1" touch tags - $ctags -w "$1" + case "$1" in + (*.[chlmy]) $ctags -w "$1";; + (*) $mtags "$1";; + esac $hilex -f html "$1" | $htagml -i "$1" ;; (*) |