LOCALE::PO4A::POD.3PM(1) | User Contributed Perl Documentation | LOCALE::PO4A::POD.3PM(1) |
名称
Locale::Po4a::Pod - 将 POD 数据从/转换为 PO 文件
简介
use Locale::Po4a::Pod; my $parser = Locale::Po4a::Pod->new (sentence => 0, width => 78); # 从标准输入读取 POD 并写入标准输出。 $parser->parse_from_filehandle; # 从 file.pod 读取 POD 并写入 file.txt。 $parser->parse_from_file ('file.pod', 'file.txt');
描述
Locale::Po4a::Pod 是一个模块,用于帮助将 POD 格式(编写 Perl 文档的首选语言)的文档翻译成其他 [人类] 语言。
此模块的状态
我认为这个模块非常稳定,/usr/lib/perl5/tk/MainWindow.pod (以及其他一些页面,见下文)中只有一个已知的 bug:
C<" #n">
Lack of luck, in the po4a version, this was split on the space by the wrapping. As result, in the original version, the man page contains:
" #n"
and mine contains:
"" #n""
这是因为 C<foobar> 被重写为 "foobar" 的逻辑。
Complete list of pages having this problem on my box (from 564 pages; note that it depends on the chosen wrapping column):
/usr/lib/perl5/Tk/MainWindow.pod /usr/share/perl/5.8.0/overload.pod /usr/share/perl/5.8.0/pod/perlapi.pod /usr/share/perl/5.8.0/pod/perldelta.pod /usr/share/perl/5.8.0/pod/perlfaq5.pod /usr/share/perl/5.8.0/pod/perlpod.pod /usr/share/perl/5.8.0/pod/perlre.pod /usr/share/perl/5.8.0/pod/perlretut.pod
内件
作为 Pod::Parser 的派生类,Locale::Po4a::Pod 支持相同的方法和接口。有关所有细节,请参见 Pod::Parser;简而言之,使用 "Locale::Po4a::Pod->new()" 创建一个新的解析器,然后调用 parse_from_filehandle() 或 parse_from_file()。
new() 可以采用键/值对形式的选项来控制解析器的行为。所有 Pod::Parser 子级通用的可识别选项为:
- alt
- 如果设置为 true 值,则选择使用不同标题样式的备用输出格式,并在左边距中用冒号标记 =Item 条目。默认值为 false。
- code
- 如果设置为 true 值,则输入文件的非 POD 部分将包括在输出中。用于查看使用 POD 块记录的代码,并呈现 POD 并保持代码不变。
- indent
- 用于缩进常规文本的空格数,以及 =over 块的默认缩进。默认为 4。
- loose
- 如果设置为 true 值,则在 =head1 标题后打印一个空行。如果设置为 false (默认值),则在 =head1 之后不打印空行,但在 =head2 之后仍打印一个空行。这是默认设置,因为这是手册页的预期格式;如果您正在格式化任意文本文档,则将其设置为 true 可能会产生更令人满意的输出。
- quotes
- 设置用于将 C<>
文本括起来的引号。如果值是单字符,则同时用作左引号和右引号;如果是两个字符,则第一个字符用作左引号,第二个字符用作右引号;如果是四个字符,则前两个字符用作左引号,后两个字符用作右引号。
也可以将其设置为特殊值 none,在这种情况下,C<> 文本两边不会添加引号。
- sentence
- 如果设置为真值,Locale::Po4a::Pod 将假定每个句子以两个空格结束,并将尝试保留该空格。如果设置为 false,则非逐字段落中的所有连续空格都将压缩为一个空格。默认值为 true。
- width
- 要在其右侧换行文本的列。默认为 76。
参见
Pod::Parser, Locale::Po4a::Man(3pm), Locale::Po4a::TransTractor(3pm), po4a(7)
作者
Denis Barbier <barbier@linuxfr.org> Martin Quinson (mquinson#debian.org)
翻译
taotieren <admin@taotieren.com>
版权和许可
版权所有 © 2002 SPI, Inc.
This program is free software; you may redistribute it and/or modify it under the terms of GPL v2.0 or later (see the COPYING file).
2024-04-28 | perl v5.38.2 |