gpt4 book ai didi

perl - 如何在 Perl POD 中记录参数

转载 作者:行者123 更新时间:2023-12-03 21:11:14 25 4
gpt4 key购买 nike

我有这个 POD:

=head1 My code

=head2 check

Checks something.

Parameters:

=over 8

=item what to check.

=back

=cut
podchecker不提示。 perldoc显示这个:
My code
check
Checks something.

Parameters:

what to check.
我希望“检查内容”行进一步缩进。
我需要如何更改我的 POD 以显示缩进的参数?
有没有比 =item 更好的方法来做到这一点?

最佳答案

两者 perldocpod2html忽略缩进级别。使用项目符号作为解决方法。请参阅下面的示例。

=head1 My code

=head2 check with no bullets or numbers

Checks something.

Parameters:

=over

=item what to check A

=item what to check B

=back

=head2 check with bullets

Checks something.

=over

=item * what to check A

=item * what to check B

=back

=head2 check with numbers

Checks something.

=over

=item 1. what to check A

=item 2. what to check B

=back

=cut

运行 perldoc /path/to/script.pl结果如下:
My code
check with no bullets or numbers
Checks something.

Parameters:

what to check A
what to check B

check with bullets
Checks something.

o what to check A

o what to check B

check with numbers
Checks something.

1. what to check A
2. what to check B
引用:

The indentlevel option to "=over" indicates how far over to indent,generally in ems (where one em is the width of an "M" in thedocument's base font) or roughly comparable units; if there is noindentlevel option, it defaults to four. (And some formatters may justignore whatever indentlevel you provide.)


(来自 perldoc perlpod ,我的黑体字)

关于perl - 如何在 Perl POD 中记录参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63759634/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com