1bb2e14f3Smrg#!/bin/sh 2bb2e14f3Smrg# 3bb2e14f3Smrg# Copyright © 2000 by Precision Insight, Inc. 4bb2e14f3Smrg# 5bb2e14f3Smrg# Generate index files for the HTML man pages 6bb2e14f3Smrg# 7bb2e14f3Smrg# Author: David Dawes <dawes@xfree86.org> 8bb2e14f3Smrg# 9bb2e14f3Smrg 10bb2e14f3SmrgVOLLIST="1 2 3 4 5 6 7 8 9 o l n p" 11bb2e14f3SmrgINDEX="manindex" 12bb2e14f3Smrg 13bb2e14f3Smrgif [ $# != 1 ]; then 14bb2e14f3Smrg echo Usage: $0 htmlmandir 15bb2e14f3Smrg exit 1 16bb2e14f3Smrgfi 17bb2e14f3Smrg 18bb2e14f3Smrgif [ ! -d $1 ]; then 19bb2e14f3Smrg echo $1 is not a directory 20bb2e14f3Smrg exit 1 21bb2e14f3Smrgfi 22bb2e14f3Smrg 23bb2e14f3Smrgcd $1 24bb2e14f3Smrg 25bb2e14f3Smrgfor s in $VOLLIST; do 26bb2e14f3Smrg list="`ls *.$s.html 2> /dev/null`" || : # ignore failed glob expansion 27bb2e14f3Smrg if [ X"$list" != X ]; then 28bb2e14f3Smrg file=$INDEX$s.html 29bb2e14f3Smrg rm -f $file 30bb2e14f3Smrg cat <<EOF > $file 31bb2e14f3Smrg<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> 32bb2e14f3Smrg<HTML> 33bb2e14f3Smrg<HEAD> 34bb2e14f3Smrg<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> 35bb2e14f3Smrg<TITLE>X.Org Manual pages: Section $s</TITLE> 36bb2e14f3Smrg</HEAD> 37bb2e14f3Smrg<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red"> 38bb2e14f3Smrg 39bb2e14f3Smrg<H1>X.Org Manual pages: Section $s</H1> 40bb2e14f3Smrg<P> 41bb2e14f3Smrg<UL> 42bb2e14f3SmrgEOF 43bb2e14f3Smrg for i in $list; do 44bb2e14f3Smrg title="`sed -e '/^[^0-9A-Za-z]/d' -e '/^$/' -e '/^Name/d' -e q $i`" 45bb2e14f3Smrg name="`echo \"$title\" | sed -e 's/ - .*//'`" 46bb2e14f3Smrg desc="`echo \"$title\" | sed -e 's/[^-]* - //' -e 's/<P>//'`" 47bb2e14f3Smrg echo "<LI><A href=\"$i\">$name</A> - $desc</LI>" >> $file 48bb2e14f3Smrg done 49bb2e14f3Smrg cat <<EOF >> $file 50bb2e14f3Smrg</UL> 51bb2e14f3Smrg<P> 52bb2e14f3Smrg</BODY> 53bb2e14f3Smrg</HTML> 54bb2e14f3SmrgEOF 55bb2e14f3Smrg fi 56bb2e14f3Smrgdone 57bb2e14f3Smrg 58bb2e14f3Smrgexit 0 59