#!/usr/local/bin/andy func dl link { set man `basename $link set dst out/man/$man mkdir -p $dst set name `echo $man | sed -E 's/(.*)\.(.)/\U\1(\2)/' { echo "header { div { h1 {-$name Manual Page}" cat include/nav.gsp echo "}} hr{}" } | gsp -d | read head curl -LSs $link | mandoc -Thtml -I os=MangoOS -Ostyle=/man/style.css | awk -v head=$head ' !/^
/ /^/ { print $0, head } ' >!$dst/index.html printf 'li {a href="%s" {-%s — %s}}\n' ( $man `printf $name | tr A-Z a-z `htmlq -t .Nd <$dst/index.html | tr -d \n | tr -s ' ' ) } cd `dirname $args[0] cd .. if ! test -f src/man/links { set argv0 `basename $args[0] echo "$argv0: Links file does not exist" >/dev/stderr exit 1 } while read -d\n -n1 _ { dl $_ }