summaryrefslogtreecommitdiff
path: root/bin/pod2x
blob: 8c020062c8bb2d2413f470e796e031654505be41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl

#use Pod::Text;
#$Pod::Text::termcap=1;

my $site_perl = "./FS";
#my $catman = "./catman";
#my $catman = "./htdocs/docs/man";
#my $html = "./htdocs/docs/man";
my $html = "./httemplate/docs/man";

$|=1;

die "Can't find $site_perl" unless -d $site_perl;
#die "Can't find $catman" unless -d $catman;
die "Can't find $html" unless -d $html;

foreach my $file (
  glob("$site_perl/*.pm"),
  glob("$site_perl/*/*.pm"),
  glob("$site_perl/*/*/*.pm")
) {
  #$file =~ /\/([\w\-]+)\.pm$/ or die "oops file $file";
  $file =~ /$site_perl\/(.*)\.pm$/ or die "oops file $file";
  my $name = $1;
  print "$name\n";
  my $htmlroot = join('/', map '..',1..(scalar($file =~ tr/\///)-2)) || '.';
#  system "pod2text $file >$catman/$name.txt"; 
  system "pod2html --podroot=$site_perl --podpath=./FS:./FS/UI:. --norecurse --htmlroot=$htmlroot $file >$html/$name.html";
#  system "pod2html $file >$html/$name.html";
}