#!/usr/local/bin/perl -w

use File::Path qw(rmtree);

rmtree([qw(man pod3 podn)],0,0);

foreach (glob("*.htm"))
 {
  unlink($_); 
 } 

# Fix man markup for tkpod2man

mkdir("man",0777) unless -d "man";
system($^X,"./fix4man2pod",glob("man3/*.3"),glob("mann/*.n"));

# Convert to pod

sub convert
{
 my $sfx = shift;
 mkdir("pod$sfx",0777) unless -d "pod$sfx";
 chdir("pod$sfx");
 system($^X,"-wI..","../tkman2pod",glob("../man/*.$sfx"));
 chdir("..");
}

convert('3');
convert('n');


# add/override with handish tuned manual pages

# cp pod/*.pod podn/

# Try to guess corresponding module name

system($^X,"./transname");

