summary refs log tree commit diff
path: root/bin/html.sh
blob: 8f4e3887bbd43c14d41800707d658e90a124e5fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
set -eu

readonly GiteaURL='https://code.causal.agency/june/src/src/branch/master/bin'

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

./hi -f html -o document,tab=4 -n "${src}" /dev/null | sed -e '/<pre/d'
cat <<- EOF
	<style>
	$(./scheme -s | sed -f style.sed)
	</style>
	<code><a href="${GiteaURL}/${src}">${src} in git</a></code>
EOF
[ -f "${man}" ] && man -P cat "${PWD}/${man}" | ./ttpre
./hi -f html -o anchor "${src}"