summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-08-23 19:15:46 -0400
committerJune McEnroe <june@causal.agency>2020-08-23 19:15:46 -0400
commitec966f4bd932379e714aafc78c6fc70117c9a704 (patch)
tree5d5d5eb816f03749538394572b938fb0895eb62c
parentUse scheme CSS variables for causal.agency (diff)
downloadsrc-ec966f4bd932379e714aafc78c6fc70117c9a704.tar.gz
src-ec966f4bd932379e714aafc78c6fc70117c9a704.zip
Use scheme for bin html
-rw-r--r--bin/Makefile2
-rw-r--r--bin/html.sh33
2 files changed, 31 insertions, 4 deletions
diff --git a/bin/Makefile b/bin/Makefile
index 09ec952e..5aa9acf9 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -116,7 +116,7 @@ WEBROOT = /usr/local/www/causal.agency
 html: ${HTMLS}
 	@true
 
-${HTMLS}: html.sh hi ttpre
+${HTMLS}: html.sh scheme hi ttpre
 
 .SUFFIXES: .html
 
diff --git a/bin/html.sh b/bin/html.sh
index e5a15fdc..4a6b52f8 100644
--- a/bin/html.sh
+++ b/bin/html.sh
@@ -6,9 +6,36 @@ readonly GitURL='https://git.causal.agency/src/tree/bin'
 src=$1
 man=${2:-}
 
-./hi -f html -o document,tab=4 -n "$src" /dev/null | sed '/<pre/d'
-cat <<- EOF
-	<code><a href="${GitURL}/${src}">${src} in git</a></code>
+cat <<EOF
+<!DOCTYPE html>
+<title>${src}</title>
+<style>
+$(./scheme -st)
+html {
+	font-family: monospace;
+	color: var(--ansi17);
+	background-color: var(--ansi16);
+}
+a { color: var(--ansi4); }
+a:visited { color: var(--ansi5); }
+pre.hi {
+	-moz-tab-size: 4;
+	tab-size: 4;
+}
+.hi.Keyword { color: var(--ansi7); }
+.hi.Macro { color: var(--ansi2); }
+.hi.Tag { color: inherit; text-decoration: underline; }
+.hi.Tag:target { color: var(--ansi11); outline: none; }
+.hi.String { color: var(--ansi6); }
+.hi.Format { color: var(--ansi14); }
+.hi.Interp { color: var(--ansi3); }
+.hi.Comment { color: var(--ansi4); }
+.hi.Todo { color: var(--ansi12); }
+.hi.DiffOld { color: var(--ansi1); }
+.hi.DiffNew { color: var(--ansi2); }
+</style>
+<a href="${GitURL}/${src}">${src} in git</a>
 EOF
+
 [ -f "$man" ] && man -P cat "${PWD}/${man}" | ./ttpre
 ./hi -f html -o anchor "$src"