我需要将 Pod 转换为 HTML。有许多 Pod::HTML 和 Pod::Simple::* 模块。我应该使用哪一个?
问问题
1297 次
1 回答
12
简短的回答是Pod::Simple::XHTML。它产生有用但简洁的 HTML 输出。您可以通过查看http://metacpan.org上的 html 源代码来查看输出示例。
它也适用于Pod::Simple::HTMLBatch,如果您要转换多个文件,您应该检查它。请注意,Pod::Simple::HTMLBatch 的默认值为 Pod::Simple::HTML。但是 Pod::Simple 的维护者 David Wheeler建议使用 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');
于 2011-07-24T18:55:46.393 回答