ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/doc/playbook/make_index.pl
Revision: 1.1
Committed: Fri Feb 3 07:12:39 2006 UTC (18 years, 4 months ago) by root
Content type: text/plain
Branch: MAIN
Branch point for: UPSTREAM
Log Message:
Initial revision

File Contents

# Content
1 #!/usr/bin/perl
2
3 # Usefull for making an index laTex file from *.idx file
4
5 if ( $#ARGV != 0 ) {
6 print "Usage: $0 <idxfilename>\n";
7 exit 0;
8 }
9
10 $idxfile=$ARGV[0];
11
12
13 open(IN,"<$idxfile") || die("Can not open $idxfile");
14
15 while(<IN>) {
16 chomp;
17 s/}//g;
18 ($junk, $idname, $page) = split /{/;
19 $idname =~ s#^\\##;
20 if ($index{$idname} eq "") {
21 $index{$idname}="$page";
22 }
23 elsif ($index{$idname} ne "$page" && ($index{$idname} !~ / $page/)) {
24 $index{$idname}.=" $page";
25 }
26 }
27 close(IN);
28
29 print "\\begin{theindex}\n";
30 foreach $i (sort(keys %index)) {
31 print "\\item $i $index{$i}\n";
32 }
33 print "\\end{theindex}\n";
34