我需要将 Pod 转换为 HTML。有许多 Pod::HTML 和 Pod::Simple::* 模块。我应该使用哪一个?
最佳答案
简短的回答是Pod::Simple::XHTML .它产生有用而简洁的 HTML 输出。您可以通过查看位于 http://metacpan.org 的 html 源代码来查看输出示例。 .
它也适用于 Pod::Simple::HTMLBatch如果您要转换多个文件,您应该检查一下。请注意,Pod::Simple::HTMLBatch 的默认值是 Pod::Simple::HTML。但是 Pod::Simple 的维护者 David Wheeler,recommends使用 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');
关于html - 我使用哪个 Perl 模块将 Pod 转换为 HTML?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6808946/