templates!!!
[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 my $html = "./httemplate/docs/man";
11
12 $|=1;
13
14 die "Can't find $site_perl" unless -d $site_perl;
15 #die "Can't find $catman" unless -d $catman;
16 die "Can't find $html" unless -d $html;
17
18 foreach my $file (
19   glob("$site_perl/*.pm"),
20   glob("$site_perl/*/*.pm"),
21   glob("$site_perl/*/*/*.pm")
22 ) {
23   #$file =~ /\/([\w\-]+)\.pm$/ or die "oops file $file";
24   $file =~ /$site_perl\/(.*)\.pm$/ or die "oops file $file";
25   my $name = $1;
26   print "$name\n";
27   my $htmlroot = join('/', map '..',1..(scalar($file =~ tr/\///)-2)) || '.';
28 #  system "pod2text $file >$catman/$name.txt"; 
29   system "pod2html --podroot=$site_perl --podpath=./FS:./FS/UI:. --norecurse --htmlroot=$htmlroot $file >$html/$name.html";
30 #  system "pod2html $file >$html/$name.html";
31 }