htmlperlperl-pod

Which Perl module do I use to convert Pod to HTML?


I need to convert Pod to HTML. There are number of Pod::HTML and Pod::Simple::* modules. Which one is the one I should use?


Solution

  • The short answer is Pod::Simple::XHTML. It produces useful yet concise HTML output. You can see an example of the output by viewing the html source at http://metacpan.org.

    It also works with Pod::Simple::HTMLBatch which you should check out if you are converting more than one file. Note that the default for Pod::Simple::HTMLBatch is Pod::Simple::HTML. But the maintainer of Pod::Simple, David Wheeler, recommends using Pod::Simple::XHTML.

    use Pod::Simple::HTMLBatch;    
    use Pod::Simple::XHTML;
    
    mkdir './html' or die "could not create directory: $!";
    
    my $convert = Pod::Simple::HTMLBatch->new;
    $convert->html_render_class('Pod::Simple::XHTML');
    $convert->add_css('http://www.perl.org/css/perl.css');
    $convert->css_flurry(0);
    $convert->javascript_flurry(0);
    $convert->contents_file(0);    
    $convert->batch_convert('./pod', './html');