#!/bin/env perl

use strict;
use warnings;
use Pod::Xhtml;
use Pod::Hyperlink::BounceURL;
use Pod::Checker;


my $linkparser = new Pod::Hyperlink::BounceURL;
$linkparser->configure( URL => './%s.html' );

my $parser = new Pod::Xhtml(
    LinkParser => $linkparser,
    MakeIndex => 1,
);

my @files = glob('man/*.pod');

foreach my $f (@ARGV) {
    next if (podchecker($f));
    my $file = $f;
    if ($file =~ m/\.pm$/) {
        $file =~ s:.*lib/::;
        $file =~ s;/+;::;g;
    } else {
        $file =~ s:^.*/::;
    }
    $file =~ s:(\.[^\.]+)?$:.html:;
    $parser->parse_from_file( 
       $f,
       "html/$file",
    );
}


