summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--www/git.causal.agency/.gitignore3
-rw-r--r--www/git.causal.agency/Makefile6
-rw-r--r--www/git.causal.agency/about-filter.sh2
-rw-r--r--www/git.causal.agency/custom.css25
-rw-r--r--www/git.causal.agency/source-filter.sh19
5 files changed, 36 insertions, 19 deletions
diff --git a/www/git.causal.agency/.gitignore b/www/git.causal.agency/.gitignore
index 8d20f25d..4f4682af 100644
--- a/www/git.causal.agency/.gitignore
+++ b/www/git.causal.agency/.gitignore
@@ -1,3 +1,4 @@
 about-filter
-hi
+hilex
+htagml
 source-filter
diff --git a/www/git.causal.agency/Makefile b/www/git.causal.agency/Makefile
index 28e08ba5..0509975f 100644
--- a/www/git.causal.agency/Makefile
+++ b/www/git.causal.agency/Makefile
@@ -3,16 +3,16 @@ WWW = /usr/local/www/cgit
 LIBEXEC = /usr/local/libexec
 
 BIN = ../../bin
-BINS = about-filter source-filter hi
+BINS = about-filter source-filter hilex htagml
 
 install: cgitrc custom.css ${BINS}
 	install -m 644 cgitrc ${ETC}
 	install -m 644 custom.css ${WWW}
 	install ${BINS} ${LIBEXEC}
 
-hi: ${BIN}/hi.c
+hilex htagml::
 	${MAKE} -C ${BIN} $@
-	cp ${BIN}/$@ $@
+	ln -f ${BIN}/$@ $@
 
 clean:
 	rm -f ${BINS}
diff --git a/www/git.causal.agency/about-filter.sh b/www/git.causal.agency/about-filter.sh
index d27d2d48..2ff645e2 100644
--- a/www/git.causal.agency/about-filter.sh
+++ b/www/git.causal.agency/about-filter.sh
@@ -10,6 +10,6 @@ case "$1" in
 		exec /usr/bin/mandoc -T html -O $options,toc
 		;;
 	(*)
-		exec /usr/local/libexec/hi -l text -f html
+		exec /usr/local/libexec/hilex -l text -f html -o pre
 		;;
 esac
diff --git a/www/git.causal.agency/custom.css b/www/git.causal.agency/custom.css
index 802882d2..48331751 100644
--- a/www/git.causal.agency/custom.css
+++ b/www/git.causal.agency/custom.css
@@ -49,20 +49,19 @@ div#cgit div#summary {
 	max-width: 80ch;
 }
 
-/* from hi(1) */
-div#cgit .hi.Keyword { color: dimgray; }
-div#cgit .hi.Macro { color: green; }
-div#cgit .hi.Tag { color: inherit; text-decoration: underline; }
-div#cgit .hi.String { color: teal; }
-div#cgit .hi.Format { color: teal; font-weight: bold; }
-div#cgit .hi.Interp { color: olive; }
-div#cgit .hi.Comment { color: navy; }
-div#cgit .hi.Todo { color: navy; font-weight: bold; }
-div#cgit .hi.DiffOld { color: red; }
-div#cgit .hi.DiffNew { color: green; }
-div#cgit .hi.Tag:target { color: goldenrod; outline: none; }
+/* for hilex(1) */
+div#cgit pre .Ke { color: dimgray; }
+div#cgit pre .Ma { color: green; }
+div#cgit pre .Co { color: navy; }
+div#cgit pre .St { color: teal; }
+div#cgit pre .Fo { color: teal; font-weight: bold; }
+div#cgit pre .Su { color: olive; }
 
-/* from mandoc(1) */
+/* for htagml(1) */
+div#cgit pre a.tag { color: inherit; text-decoration: underline; }
+div#cgit pre a.tag:target { color: goldenrod; outline: none; }
+
+/* for mandoc(1) */
 table.head, table.foot { width: 100%; }
 td.head-rtitle, td.foot-os { text-align: right; }
 td.head-vol { text-align: center; }
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