aboutsummaryrefslogtreecommitdiff
path: root/dist/manweb
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-01-14 03:45:44 +0000
committerrsc <devnull@localhost>2005-01-14 03:45:44 +0000
commit78e51a8c6678b6e3dff3d619aa786669f531f4bc (patch)
tree015e00fde4fc837fd31b705e18d17dc913829388 /dist/manweb
parent2634795b5f0053bc0ff08e5d7bbc0eda8efea061 (diff)
downloadplan9port-78e51a8c6678b6e3dff3d619aa786669f531f4bc.tar.gz
plan9port-78e51a8c6678b6e3dff3d619aa786669f531f4bc.tar.bz2
plan9port-78e51a8c6678b6e3dff3d619aa786669f531f4bc.zip
checkpoint
Diffstat (limited to 'dist/manweb')
-rwxr-xr-xdist/manweb64
1 files changed, 64 insertions, 0 deletions
diff --git a/dist/manweb b/dist/manweb
new file mode 100755
index 00000000..0a6f0f40
--- /dev/null
+++ b/dist/manweb
@@ -0,0 +1,64 @@
+#!/usr/local/plan9/bin/rc
+
+path=($PLAN9/bin $path)
+cd $PLAN9/man
+# rm -f */*.html
+
+for(i in */INDEX) @{
+ n=`{echo $i | sed 's/man//;s!/INDEX!!'}
+ cat $PLAN9/dist/manindextop.html | sed 's/NNN/'$n'/g'
+ cd `{basename -d $i}
+ # complicated sort order: want 9p.3, 9p-cmdbuf.3, 9pclient.3
+ for (j in `{ls [a-z0-9:]*.[0-9]* | sed 's/[.\-]/ &/g;s/\./ &/g' | sort | tr -d ' '}){
+ n=`{grep '^\.TH' $j | sed 1q | awk '{print $3}'}
+ name=`{echo $j | sed 's/\..*//'}
+ if(~ $name 0intro)
+ name=intro
+ if not{
+ echo '<tr height=1><td>'
+ echo '<tr height=1><td colspan=2 bgcolor=#cccccc>'
+ echo '<tr height=1><td>'
+ }
+ echo -n '<tr><td valign=top><a href="'$name'.html">'$name'('$n')</a><td>'
+ sed -n '
+ /SH *NAM/,/SH/{
+ /SH/d
+ s/, *$//
+ ty
+ :y
+ s/ *\\*-.*/&/
+ tx
+ s/ *\\\(mi.*/&/
+ tx
+ s/\n\\n/\
+/g
+ p
+ }
+ /SH *DES/q
+ d
+ :x
+ /^$/d
+ s/\n\n/\
+/g
+ s/\\-/\&ndash;/
+ p
+ q' $j
+ }
+ cat $PLAN9/dist/manindexbottom.html
+} >$i.html && mv $i.html `{echo $i.html | tr A-Z a-z}
+
+for (i in */[~.]*.[0-9]*){
+ j=`{echo $i | 9 sed 's/\..*//'}
+ p=`{basename $j}
+ d=`{basename -d $j}
+ if(~ $p 0intro)
+ p=intro
+ echo $d/$p
+ troff -manhtml $i | troff2html -t 'Plan 9 from User Space'>/tmp/manweb.html
+ {
+ sed '/<!-- TRAILER -->/q' /tmp/manweb.html
+ cat $PLAN9/dist/mantrailer.html
+ sed -n '/<!-- TRAILER -->/,$p' /tmp/manweb.html
+ } >$d/$p.html
+}
+rm /tmp/manweb.html