Debian Codegraph @

imake/mkhtmlindex.sh

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