ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/doc/playbook/make_index.pl
Revision: 1.2
Committed: Thu Sep 7 21:43:15 2006 UTC (17 years, 9 months ago) by pippijn
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
State: FILE REMOVED
Log Message:
Moved documents to doc/historic

File Contents

# User Rev Content
1 root 1.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