Changeset 1593 for trunk/swish_website/bin/split.pl
- Timestamp:
- 01/19/05 02:05:07 (4 years ago)
- Files:
-
- trunk/swish_website/bin/split.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/swish_website/bin/split.pl
r1587 r1593 1 1 #!/usr/bin/perl -w 2 2 use strict; 3 use warnings; 3 4 use File::Find; 4 5 5 6 my $dir = shift || die "failed to specify directory"; 7 my $pat = qr!<h\d><a name="([^"]+)"></a>([^<]+)</h\d>!i; #" for vim 8 9 10 if ( -f $dir ) { 11 warn "Indexing [$dir] as a single file\n"; 12 index_path( $dir ); 13 exit; 14 } 6 15 7 16 find( \&process_doc, $dir ); … … 11 20 12 21 13 my $pat = qr[<h\d><a name="([^"]+)">([^<]+)</a></h\d>]i;14 22 15 23 … … 31 39 return if $dir =~ m!/graphics!; 32 40 41 index_path( $path ); 42 } 43 44 sub index_path { 45 my ( $path ) = @_; 33 46 34 47 unless ( open( FH, "<$path" ) ) { 35 warn "Failed to open file [$path]\n";48 warn "Failed to open file - [$path]: $!\n"; 36 49 return; 37 50 } … … 43 56 sub index_doc { 44 57 my ($name, $doc) = @_; 58 45 59 46 60 … … 55 69 $title ||= "Swish-e Documentation"; 56 70 57 $title =~ s/^S WISH-Enhanced: //;71 $title =~ s/^Swish-e :: //; 58 72 59 73
