11
B<collateindex.pl> [B<-p>] [B<-g>] [B<-s> I<name>] [B<-t> I<name>] [B<-P> F<file>]
12
[B<-i> I<id>] [B<-o> F<file>] [B<-S> I<scope>] [B<-I> I<scope>]
13
[B<-x>] [B<-f>] [B<-N>] [B<-q>] [F<file>
11
B<collateindex.pl> [B<-f>] [B<-g>] [B<-i> I<id>] [B<-I> I<scope>] [B<-N>]
12
[B<-o> F<file>] [B<-p>] [B<-P> F<file>] [B<-q>] [B<-s> I<name>]
13
[B<-S> I<scope>] [B<-t> I<name>] [B<-x>] F<file>
17
B<collateindex.pl> is a Perl script that creates index data for
18
DocBook XML or SGML files.
17
B<collateindex.pl> creates index data for DocBook XML or SGML files.
24
$usage = "usage: $0 [options] file
25
Do 'perldoc $0' for documentation.\n";
27
( $version = '$Revision: 1.8 $' ) =~ s/^\$[R]evision:\s*([^ ]*)\s*\$$/$1/;
26
$usage = "Usage: $0 [options] file
27
Try \"perldoc $me\" for documentation.\n";
29
( $version = '$Revision: 1.10 $' ) =~ s/^\$[R]evision:\s*([^ ]*)\s*\$$/$1/;
35
Link to points in the document. The default is to link to the closest
37
Force the output file to be written, even if it appears to have been
40
42
Group terms with IndexDiv based on the first letter of the term (or
41
its sortas attribute). (This probably doesn't handle i10n
46
Name the IndexDiv that contains symbols. The default is 'Symbols'.
47
Meaningless if B<-g> is not used.
55
Read a preamble from F<file>. The contents of F<file> will be
56
inserted before the E<lt>indexE<gt> tag.
43
its SortAs attribute). (This might not handle all language environments.)
60
47
The ID to use for the E<lt>indexE<gt> tag.
64
Output to F<file>. Defaults to F<stdout>.
68
Scope of the index, must be C<all>, C<local>, or C<global>. If
69
unspecified, C<all> is assumed.
71
49
=item B<-I> I<scope>
73
51
The implied scope, must be C<all>, C<local>, or C<global>. IndexTerms
74
52
which do not specify a scope will have the implied scope. If
75
53
unspecified, C<all> is assumed.
83
Force the output file to be written, even if it appears to have been
88
57
New index (generates an empty index file).
61
Output to F<file>. Defaults to F<stdout>.
65
Link to points in the document. The default is to link to the closest
70
Read a preamble from F<file>. The contents of F<file> will be
71
inserted before the E<lt>indexE<gt> tag.
79
Name the IndexDiv that contains symbols. The default is C<Symbols>.
80
Meaningless if B<-g> is not used.
84
Scope of the index, must be C<all>, C<local>, or C<global>. If
85
unspecified, C<all> is assumed.
96
97
Print version number and exit.
100
The file containing index data generated by B<Jade> with the DocBook
101
The file containing index data generated with the DocBook DSSSL
102
HTML stylesheet (usually called F<HTML.index>).
147
148
$dat = shift @ARGV || die $usage;
148
die "$0: cannot find $dat.\n" if ! -f $dat;
149
die "$me: file \"$dat\" does not exist\n" if ! -f $dat;
150
151
%legal_scopes = ('ALL' => 1, 'LOCAL' => 1, 'GLOBAL' => 1);
151
152
if ($scope && !$legal_scopes{$scope}) {
152
die "Invalid scope.\n$usage\n";
153
die "$me: invalid scope: $scope\n";
154
155
if ($impliedscope && !$legal_scopes{$impliedscope}) {
155
die "Invalid implied scope.\n$usage\n";
156
die "$me: invalid implied scope: $impliedscope\n";
678
print "\n$outfile appears to have been edited by hand; use -f or\n";
679
print " change the output file.\n";
679
print STDERR "$me: file \"$outfile\" appears to have been edited by hand\n";
680
print STDERR "Use the -f option or specify a different output file name.\n";
684
open (OUT, ">$outfile") || die "$usage\nCannot write to $outfile.\n";
685
open (OUT, ">$outfile") || die "$me: could not open file \"$outfile\": $!\n";
687
688
# Copy the preamble