From e7bf571b45189e2be9041d4d0d4cc21d2fa803a7 Mon Sep 17 00:00:00 2001 From: fukachan Date: Sat, 28 Apr 2001 10:55:06 +0000 Subject: 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. --- fml/utils/bin/pm2txt.pl | 61 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) (limited to 'fml/utils') 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 "\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 "\n"; + print $wh "
$name\n"; + print $wh "[source]\n"; + print $wh "[manual]\n"; + print $wh "\n"; + } + print $wh "
\n"; + + $wh->close; +} + 1; -- cgit v1.2.1