开发者

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

开发者 https://www.devze.com 2023-03-23 01:38 出处:网络
I need to convert Pod to HTML.There are number of Pod::开发者_JAVA百科HTML and Pod::Simple::* modules.Which one is the one I should use?The short answer is Pod::Simple::XHTML.It produces useful yet co

I need to convert Pod to HTML. There are number of Pod::开发者_JAVA百科HTML and Pod::Simple::* modules. Which one is the one I should use?


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');
0

精彩评论

暂无评论...
验证码 换一张
取 消