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 子級通用的可識別選項為:

如果設定為 true 值,則選擇使用不同標題樣式的備用輸出格式,並在左邊距中用冒號標記 =Item 條目。預設值為 false。
如果設定為 true 值,則輸入檔案的非 POD 部分將包括在輸出中。用於檢視使用 POD 塊記錄的程式碼,並呈現 POD 並保持程式碼不變。
用於縮排常規文字的空格數,以及 =over 塊的預設縮排。預設為 4。
如果設定為 true 值,則在 =head1 標題後列印一個空行。如果設定為 false (預設值),則在 =head1 之後不列印空行,但在 =head2 之後仍列印一個空行。這是默認設定,因為這是手冊頁的預期格式;如果您正在格式化任意文字文件,則將其設定為 true 可能會產生更令人滿意的輸出。
設定用於將 C<> 文字括起來的引號。如果值是單字元,則同時用作左引號和右引號;如果是兩個字元,則第一個字元用作左引號,第二個字元用作右引號;如果是四個字元,則前兩個字元用作左引號,後兩個字元用作右引號。

也可以將其設定為特殊值 none,在這種情況下,C<> 文字兩邊不會新增引號。

如果設定為真值,Locale::Po4a::Pod 將假定每個句子以兩個空格結束,並將嘗試保留該空格。如果設定為 false,則非逐欄位落中的所有連續空格都將壓縮為一個空格。默認值為 true。
要在其右側換行文字的列。預設為 76。

另請參見

Pod::Parser, Locale::Po4a::Man(3pm), Locale::Po4a::TransTractor(3pm), po4a(7)

作者

Denis Barbier <barbier@linuxfr.org>
Martin Quinson (mquinson#debian.org)

版權和許可

版權所有 © 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