2c10a30d0997ca57c08300393acf7f950179432e
[freeside.git] / bin / pod2x
1 #!/usr/bin/perl
2
3 #use Pod::Text;
4 #$Pod::Text::termcap=1;
5
6 my $site_perl = "./FS";
7 #my $catman = "./catman";
8 #my $catman = "./htdocs/docs/man";
9 my $html = "./htdocs/docs/man";
10
11 $|=1;
12
13 die "Can't find $site_perl and $catman"
14   unless [ -d $site_perl ] && [ -d $catman ] && [ -d $html ];
15
16 foreach my $file (
17   glob("$site_perl/*.pm"),
18   glob("$site_perl/*/*.pm"),
19   glob("$site_perl/*/*/*.pm")
20 ) {
21   #$file =~ /\/([\w\-]+)\.pm$/ or die "oops file $file";
22   $file =~ /$site_perl\/(.*)\.pm$/ or die "oops file $file";
23   my $name = $1;
24   print "$name\n";
25   my $htmlroot = join('/', map '..',1..(scalar($file =~ tr/\///)-2)) || '.';
26 #  system "pod2text $file >$catman/$name.txt"; 
27   system "pod2html --podroot=$site_perl --podpath=./FS:./FS/UI:. --norecurse --htmlroot=$htmlroot $file >$html/$name.html";
28 #  system "pod2html $file >$html/$name.html";
29 }