diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-12-25 03:23:44 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-12-25 03:23:44 +0100 |
commit | e50db1d199eb18a9d9e5ab02c3928989f4a7d81f (patch) | |
tree | ddf2f58a76fdf966ab577f22d4165d77946ca472 /include | |
parent | f806cd8b43227b66fe181cb8d0ffb4a4cdc00070 (diff) |
Experimentally add a section for manual pages
Diffstat (limited to 'include')
-rwxr-xr-x | include/mkman | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/mkman b/include/mkman new file mode 100755 index 0000000..30250eb --- /dev/null +++ b/include/mkman @@ -0,0 +1,39 @@ +#!/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 -Ostyle=/man/style.css + | awk -v head=$head ' + !/^<body>/ + /^<body>/ { 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 $_ +} <src/man/links | sort |