diff options
| author | fukachan <fukachan> | 2001-04-28 10:55:06 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-04-28 10:55:06 +0000 |
| commit | e7bf571b45189e2be9041d4d0d4cc21d2fa803a7 (patch) | |
| tree | 00f1a173ab66039bb6c55b61377019d9a78b7f33 /fml/utils | |
| parent | e91f6c5b2c6a3a4a57012f88efe878d53bc5d32f (diff) | |
| download | fml8-e7bf571b45189e2be9041d4d0d4cc21d2fa803a7.tar.gz fml8-e7bf571b45189e2be9041d4d0d4cc21d2fa803a7.tar.bz2 fml8-e7bf571b45189e2be9041d4d0d4cc21d2fa803a7.zip | |
generate table of (module, source, manual ( by pod2txt) ) in
Documentation/en/modules/.
modify menu to use it.
disable to make index.html in each module directories.
Diffstat (limited to 'fml/utils')
| -rwxr-xr-x | fml/utils/bin/pm2txt.pl | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/fml/utils/bin/pm2txt.pl b/fml/utils/bin/pm2txt.pl index 02f01e94..7a2a7822 100755 --- a/fml/utils/bin/pm2txt.pl +++ b/fml/utils/bin/pm2txt.pl @@ -5,12 +5,12 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML$ +# $FML: pm2txt.pl,v 1.1 2001/04/27 04:42:13 fukachan Exp $ # use strict; use Carp; -use vars qw($debug); +use vars qw($debug %PMList %TxtList); use FileHandle; use File::stat; @@ -27,6 +27,7 @@ sub convert _mkdir(@_); _convert(@_); + _make_index(@_); } @@ -73,6 +74,10 @@ sub _convert $dst =~ s@//@/@g; $dst =~ s/.pm/.txt/; + # saved for + $PMList{ $src } = $src; + $TxtList{ $src } = $dst; + $go = 0; $sstat = stat($src) || croak("cannot stat $src"); @@ -97,4 +102,56 @@ sub _convert } +sub _make_index +{ + my ($src_dir, $dst_dir) = @_; + my ($up_dir); + my (%list, %pmlink, %txtlink); + + $up_dir = $dst_dir; + $up_dir =~ s/\w+/../g; + + for (keys %PMList) { + my $x = $_; + $x =~ s/$src_dir//; + $x =~ s@^/@@; + $list{ $_ } = $x; + $pmlink{ $x } = "$up_dir/$src_dir/$x"; + } + + my $dir = $src_dir; + $dir =~ s@^/@@; + $dir =~ s@/$@@; + $dir =~ s@/@-@g; + my $index = "$dst_dir/${dir}-index.html"; + my $wh = new FileHandle "> $index"; + + print "generate $index\n"; + + my $level = 0; + print $wh "<TABLE>\n"; + for (sort keys %list) { + my $name = $_; + my $txt = $TxtList{ $_ }; + my $x = $list{ $_ }; + + $name =~ s@$src_dir@@; + $name =~ s@^/@@; + $name =~ s@.pm$@@; + $name =~ s@/@::@g; + + $txt =~ s@$dst_dir@@; + $txt =~ s@^/@@; + + print $wh "<TR>\n"; + print $wh "<TD>$name\n"; + print $wh "<TD><A HREF=\"", $pmlink{ $x }, "\">[source]</A>\n"; + print $wh "<TD><A HREF=\"", $txt, "\">[manual]</A>\n"; + print $wh "\n"; + } + print $wh "</TABLE>\n"; + + $wh->close; +} + 1; |
