PerlPod - 链接似乎不起作用

时间:2013-05-28 16:52:09

标签: perl perldoc

我的POD文档中有以下行:

This is taken by the L<< Promoted Build
Plugin|https://wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin
>> C<$PROMOTED_JOB_NAME> environment variable.

我想将其格式化为:

This is taken by the 
<a href="https://wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin">
Promoted Builds Plugin</a> <code>$PROMOTED_JOB_NAME</code>
environment variable.

但是,当我运行pod2html时,我收到以下错误:

/usr/bin/pod2html: jdescribe.pl: cannot resolve 
L<Promoted Build Plugin|https://wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin>
 in paragraph 46.

根据Perlpod文档和Perlpodspec文档,这应该是正确的。或者,至少它看起来像我。

我做错了什么?

顺便说一句,这些链接可以与pod2markdown一起使用。

1 个答案:

答案 0 :(得分:2)

与已经假定的可选项一样,你的pod2html太旧了。事情开始在perl 5.14.x和perl 5.16.x之间的某个时刻起作用。

解释一下:在旧时代,构造L<text|href>被禁止。这样做的原因是,如果仅显示链接文本,则非超文本Pod渲染器(例如pod2text)将丢失信息。使用此提交在perlpodspec.pod中删除了此禁止:

commit f6e963e4dd62b8e3c01b31f4a4dd57e47e104997
Author: Ricardo Signes <rjbs@cpan.org>
Date:   Mon Dec 7 18:19:28 2009 -0500

    remove prohibition against L<text|href>

如今,pod2text显示了text <href>这样的链接。而pod2html现在也能够创建一个真正的链接。

如果您无法切换到较新版本的pod2html,则必须限制为没有文本部分的链接,例如L<http://wiki.jenkinsci.org/display/JENKINS/Promoted+Foo+Bar>

相关问题