summary refs log tree commit diff
path: root/bin/html.sh
blob: e96a72103e4e1b43da947b483643215b6bd27cce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
set -eu

readonly GitURL='https://git.causal.agency/src/tree/bin'

src=$1
man=${2:-}

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 -t -f html -o anchor "$src"
50e36b4b909af44827ff8d233720683054af8f79&follow=1'>Alias bc='bc -l'June McEnroe 2018-08-20Update usage of scheme in READMEJune McEnroe 2018-08-20Use scheme.h in fbatt and fbclockJune McEnroe 2018-08-20Generate scheme.hJune McEnroe 2018-08-20Add dependencies on gfx.hJune McEnroe 2018-08-18Add Blondie — Heart of GlassJune McEnroe 2018-08-18Set FCEDIT=$EDITORJune McEnroe 2018-08-18Only post commits with bodies to MastodonJune McEnroe 2018-08-18Run tf/cfg link script with /bin/shJune McEnroe 2018-08-18Run {,s,t}up with /bin/shJune McEnroe 2018-08-18Use whence instead of typeJune McEnroe 2018-08-18Cut off path components until right prompt fitsJune McEnroe 2018-08-17Add "private" alias to source encrypted fileJune McEnroe 2018-08-17Add vim mapping to add a #includeJune McEnroe