5.38.0

名前

perlpodspec - Plain Old Documentation: format specification and notes

perlpodspec - Plain Old Documentation: フォーマット仕様とメモ

説明

This document is detailed notes on the Pod markup language. Most people will only have to read perlpod to know how to write in Pod, but this document may answer some incidental questions to do with parsing and rendering Pod.

この文書は、Pod マークアップ言語の詳細なメモです。 ほとんどの人にとっては、Pod の書き方を知るには perlpod だけを 読む必要がありますが、この文書は Pod のパースとレンダリングに関する 付随的な質問に答えているかも知れません。

In this document, "must" / "must not", "should" / "should not", and "may" have their conventional (cf. RFC 2119) meanings: "X must do Y" means that if X doesn't do Y, it's against this specification, and should really be fixed. "X should do Y" means that it's recommended, but X may fail to do Y, if there's a good reason. "X may do Y" is merely a note that X can do Y at will (although it is up to the reader to detect any connotation of "and I think it would be nice if X did Y" versus "it wouldn't really bother me if X did Y").

この文書では、"must" / "must not", "should" / "should not", "may" は形式的な意味 (RFC 2119 参照) を持ちます: "X must do Y" は、もし X は Y していない場合、これは仕様に反しているので、 本当に修正されるべきということを意味します。 "X should do Y" は、推奨はしますが、もし適切な理由があるなら、 X が Y しないこともあることを意味します。 "X may do Y" は、単に X が自分の意志で Y できることを示しています (しかし、これは読者が 「そして、私はもし X が Y するなら すてきだ と思う」と、 「X が Y するかどうかは どうでもいい」という言外の意味を識別できるように するようにしています)(訳注: 原文がどの表現を用いているかは文末にかっこで 示します)。

Notably, when I say "the parser should do Y", the parser may fail to do Y, if the calling application explicitly requests that the parser not do Y. I often phrase this as "the parser should, by default, do Y." This doesn't require the parser to provide an option for turning off whatever feature Y is (like expanding tabs in verbatim paragraphs), although it implicates that such an option may be provided.

特に、「パーサは Y するべきです(should)」と書いた場合、 呼び出し元のアプリケーションが明示的に Y しない ように指定した場合、 Y しないかもしれません。 これはしばしば、「パーサはデフォルトでは Y するべきです(should)」と 表現されます。 これはパーサが(そのままの段落でタブを展開するといった)機能 Y を オフにするかどうかのオプションを提供することを要求している わけではありませんが、 このようなオプションが提供されている かもしれない ことを示しています。

Pod の定義

Pod is embedded in files, typically Perl source files, although you can write a file that's nothing but Pod.

Pod は他のファイル (典型的には Perl ソースファイル) に埋め込まれていますが、 Pod 以外のことは全く知らなくても Pod を書けます。

A line in a file consists of zero or more non-newline characters, terminated by either a newline or the end of the file.

ファイルの (line) は 0 個以上の改行でない文字で構成され、 改行かファイルの終わりで終端されます。

A newline sequence is usually a platform-dependent concept, but Pod parsers should understand it to mean any of CR (ASCII 13), LF (ASCII 10), or a CRLF (ASCII 13 followed immediately by ASCII 10), in addition to any other system-specific meaning. The first CR/CRLF/LF sequence in the file may be used as the basis for identifying the newline sequence for parsing the rest of the file.

改行シーケンス (newline sequence) は普通プラットフォーム依存の 概念ですが、Pod パーサは CR (ASCII 13), LF (ASCII 10), CRLF (ASCII 13 の直後に ASCII 10) に加えて、その他の システム固有の意味ののどれでも認識するべきです(should)。 ファイルの最初の CR/CRLF/LF シーケンスを、ファイルの残りをパースするための 改行を識別するための基準として使ってもかまいません(may)。

A blank line is a line consisting entirely of zero or more spaces (ASCII 32) or tabs (ASCII 9), and terminated by a newline or end-of-file. A non-blank line is a line containing one or more characters other than space or tab (and terminated by a newline or end-of-file).

空行 (blank line) は 0 個以上のスペース (ASCII 32) かタブ (ASCII 9) のみで 構成され、改行かファイルの終わりで終端されます。 非空行 (non-blank line) はスペースとタブ以外の文字 1 個以上を含みます (そして改行かファイルの終わりで終端されます)。

(Note: Many older Pod parsers did not accept a line consisting of spaces/tabs and then a newline as a blank line. The only lines they considered blank were lines consisting of no characters at all, terminated by a newline.)

(注意: 古い Pod パーサの多くはスペースとタブで構成される行を 受け付けず、改行を空行として扱います。 これらのパーサは 何の文字も含まれていない 行だけを空行として 扱います。)

Whitespace is used in this document as a blanket term for spaces, tabs, and newline sequences. (By itself, this term usually refers to literal whitespace. That is, sequences of whitespace characters in Pod source, as opposed to "E<32>", which is a formatting code that denotes a whitespace character.)

空白 (whitespace) は、この文書ではスペース、タブ、改行シーケンスを 総称する用語です。 (それ自体、この用語は普通リテラルな空白を参照します。 これは、Pod ソース中の空白文字の並びです; 一方 "E<32>" は 空白文字を 意味する フォーマッティングコードです。)

A Pod parser is a module meant for parsing Pod (regardless of whether this involves calling callbacks or building a parse tree or directly formatting it). A Pod formatter (or Pod translator) is a module or program that converts Pod to some other format (HTML, plaintext, TeX, PostScript, RTF). A Pod processor might be a formatter or translator, or might be a program that does something else with the Pod (like counting words, scanning for index points, etc.).

Pod パーサ (Pod parser) は Pod をパースするためのモジュールです (これはコールバックを呼び出すかパース木を構築するか直接フォーマットするかに 関わりません)。 Pod フォーマッタ (Pod formatter) (または Pod トランスレータ (Pod translator)) は Pod を他の形式 (HTML, プレーンテキスト、Tex, PostScript, RTF) に変換するモジュールかプログラムです。 Pod プロセッサ (Pod processor) はフォーマッタあるいはトランスレータか、 あるいは Pod に何かの処理(単語を数える、インデックスをスキャンする、など)を 行うプログラムかも知れません。

Pod content is contained in Pod blocks. A Pod block starts with a line that matches m/\A=[a-zA-Z]/, and continues up to the next line that matches m/\A=cut/ or up to the end of the file if there is no m/\A=cut/ line.

Pod の内容は Pod ブロック (Pod blocks) に含まれています。 一つの Pod ブロックは m/\A=[a-zA-Z]/ にマッチングする行で開始し、 m/\A=cut/ にマッチングする次の行までか、もし m/\A=cut/ 行がなければファイルの最後まで続きます。

Note that a parser is not expected to distinguish between something that looks like pod, but is in a quoted string, such as a here document.

パーサーは、ヒヤドキュメントのように、pod のように見えるけれども クォート文字列の中にあるのを区別することを装丁していないことに 注意してください。

Within a Pod block, there are Pod paragraphs. A Pod paragraph consists of non-blank lines of text, separated by one or more blank lines.

Pod ブロックの内部は、Pod 段落(Pod paragraphs) です。 一つの Pod 段落は、1 以上の空行で分割された非空行のテキストで構成されます。

For purposes of Pod processing, there are four types of paragraphs in a Pod block:

Pod 処理のために、Pod ブロックには 4 種類の段落があります:

  • A command paragraph (also called a "directive"). The first line of this paragraph must match m/\A=[a-zA-Z]/. Command paragraphs are typically one line, as in:

    コマンド段落 (command paragraph) (「指示子」(directive) とも呼ばれます)。 段落の最初の行は m/\A=[a-zA-Z]/ にマッチングしなければなりません(must)。 コマンド段落は典型的には以下のように 1 行です:

      =head1 NOTES
    
      =item *

    But they may span several (non-blank) lines:

    しかし複数の (非空行の) 行にわたってもかまいません(may):

      =for comment
      Hm, I wonder what it would look like if
      you tried to write a BNF for Pod from this.
    
      =head3 Dr. Strangelove, or: How I Learned to
      Stop Worrying and Love the Bomb

    Some command paragraphs allow formatting codes in their content (i.e., after the part that matches m/\A=[a-zA-Z]\S*\s*/), as in:

    一部の コマンド段落は、以下のように、内容 (つまり、 m/\A=[a-zA-Z]\S*\s*/ にマッチングする部分の後)にフォーマッティングコードを 許しています:

      =head1 Did You Remember to C<use strict;>?

    In other words, the Pod processing handler for "head1" will apply the same processing to "Did You Remember to C<use strict;>?" that it would to an ordinary paragraph (i.e., formatting codes like "C<...>") are parsed and presumably formatted appropriately, and whitespace in the form of literal spaces and/or tabs is not significant.

    言い換えると、"head1" の Pod 処理ハンドラは、 "Did You Remember to C<use strict;>?" を、通常の段落 (つまり、"C<...>" のようなフォーマッティングコード) が パースされ、おそらくは適切にフォーマットされ、リテラルのスペースや タブといった形の空白は無視されるというのと同じ処理を適用します。

  • A verbatim paragraph. The first line of this paragraph must be a literal space or tab, and this paragraph must not be inside a "=begin identifier", ... "=end identifier" sequence unless "identifier" begins with a colon (":"). That is, if a paragraph starts with a literal space or tab, but is inside a "=begin identifier", ... "=end identifier" region, then it's a data paragraph, unless "identifier" begins with a colon.

    そのままの段落 (verbatim paragraph)。 この段落の最初の行はリテラルのスペースかタブでなければならず(must)、 この段落は "identifier" がコロン (":") で始まっていない限り "=begin identifier", ... "=end identifier" を内部に 含んではいけません(must not)。 つまり、もし段落がリテラルのスペースかタブで始まっているけれども、 内部に "=begin identifier", ... "=end identifier" 領域がある場合、 "identifier" がコロンで始まっていない限りデータ段落です。

    Whitespace is significant in verbatim paragraphs (although, in processing, tabs are probably expanded).

    空白はそのままの段落では 意味を持ちます (しかし、処理中に、タブは おそらく展開されます)。

  • An ordinary paragraph. A paragraph is an ordinary paragraph if its first line matches neither m/\A=[a-zA-Z]/ nor m/\A[ \t]/, and if it's not inside a "=begin identifier", ... "=end identifier" sequence unless "identifier" begins with a colon (":").

    通常の段落 (ordinary paragraph)。 最初の行が m/\A=[a-zA-Z]/ にも m/\A[ \t]/ にもマッチングせず、 かつ、コロン (":") 以外で始まる "identifier" に対する "=begin identifier" ... "=end identifier" シーケンスの内側で ない段落は、通常の段落です。

  • A data paragraph. This is a paragraph that is inside a "=begin identifier" ... "=end identifier" sequence where "identifier" does not begin with a literal colon (":"). In some sense, a data paragraph is not part of Pod at all (i.e., effectively it's "out-of-band"), since it's not subject to most kinds of Pod parsing; but it is specified here, since Pod parsers need to be able to call an event for it, or store it in some form in a parse tree, or at least just parse around it.

    データ段落 (data paragraph)。 これは "=begin identifier" ... "=end identifier" シーケンスの 内部で、"identifier" がリテラルのコロン (":") で 始まって いない ものです。 ある意味では、データ段落は Pod の一部ではありません (事実上「帯域外」です); なぜならほとんどの種類の Pod パーサが 想定していないからです; しかし、Pod パーサはこれのためのイベントを 呼び出したり、パース木に何らかの形で補完したり、あるいは少なくとも 単にその 周り をパースする必要があるからです。

For example: consider the following paragraphs:

例えば: 以下の段落を考えます:

  # <- that's the 0th column

  =head1 Foo

  Stuff

    $foo->bar

  =cut

Here, "=head1 Foo" and "=cut" are command paragraphs because the first line of each matches m/\A=[a-zA-Z]/. "[space][space]$foo->bar" is a verbatim paragraph, because its first line starts with a literal whitespace character (and there's no "=begin"..."=end" region around).

ここで、"=head1 Foo" と "=cut" は、それぞれ最初の行が m/\A=[a-zA-Z]/ に マッチングするのでコマンド段落です。 "[space][space]$foo->bar" は、最初の行がリテラルの空白文字で始まる (そして周りに "=begin"..."=end" 領域がない)のでそのままの段落です。

The "=begin identifier" ... "=end identifier" commands stop paragraphs that they surround from being parsed as ordinary or verbatim paragraphs, if identifier doesn't begin with a colon. This is discussed in detail in the section "About Data Paragraphs and "=begin/=end" Regions".

"=begin identifier" ... "=end identifier" コマンドは、 identifier がコロンで始まっていないなら、その内部の段落を、 通常の段落やそのままの段落として解釈するのを停止させます。 これは "About Data Paragraphs and "=begin/=end" Regions" の節で詳しく 議論しています。

Pod コマンド

This section is intended to supplement and clarify the discussion in "Command Paragraph" in perlpod. These are the currently recognized Pod commands:

この章は "Command Paragraph" in perlpod での議論を補完して明確化することを 目的にしています。 現在認識されている Pod コマンドは以下の通りです:

"=head1", "=head2", "=head3", "=head4", "=head5", "=head6"

This command indicates that the text in the remainder of the paragraph is a heading. That text may contain formatting codes. Examples:

このコマンドは、この段落の残りの文章が見出しであることを示します。 この文章にはフォーマッティングコードを含むことができます。 例:

  =head1 Object Attributes

  =head3 What B<Not> to Do!

Both =head5 and =head6 were added in 2020 and might not be supported on all Pod parsers. Pod::Simple 3.41 was released on October 2020 and supports both of these providing support for all Pod::Simple-based Pod parsers.

=head5=head6 は 2020 に追加されたので、全ての Pod パーサで 対応していないかもしれません。 Pod::Simple 3.41 は 2020 年 10 月にリリースされ、 全ての Pod::Simple ベースの Pod パーサにこれらの対応を 提供しています。

"=pod"

This command indicates that this paragraph begins a Pod block. (If we are already in the middle of a Pod block, this command has no effect at all.) If there is any text in this command paragraph after "=pod", it must be ignored. Examples:

このコマンドは、この段落から Pod ブロックが始まることを示します。 (すでに Pod ブロックの内部である場合は、このコマンドは何の効果も ありません。) もしこのコマンド段落の "=pod" の後に何らかの文章がある場合、 無視しなければなりません(must)。 例:

  =pod

  This is a plain Pod paragraph.

  =pod This text is ignored.
"=cut"

This command indicates that this line is the end of this previously started Pod block. If there is any text after "=cut" on the line, it must be ignored. Examples:

このコマンドは、この行が Pod ブロックの終わりであることを示します。 この行の "=cut" の後にテキストがあれば、これは 無視しなければなりません(must)。 例:

  =cut

  =cut The documentation ends here.

  =cut
  # This is the first line of program text.
  sub foo { # This is the second.

It is an error to try to start a Pod block with a "=cut" command. In that case, the Pod processor must halt parsing of the input file, and must by default emit a warning.

Pod ブロックを "=cut" コマンドで 開始 しようとするとエラーになります。 この場合、Pod プロセッサは入力ファイルのパースを中止しなければならず(must)、 デフォルトでは警告を出力しなければなりません(must)。

"=over"

This command indicates that this is the start of a list/indent region. If there is any text following the "=over", it must consist of only a nonzero positive numeral. The semantics of this numeral is explained in the "About =over...=back Regions" section, further below. Formatting codes are not expanded. Examples:

このコマンドは、これがリスト/インデント領域の開始であることを示します。 "=over" に引き続いてなんらかのテキストがある場合は、それは非ゼロの 正数のみでなければなりません(must)。 この数値の意味論はかなり後ろの "About =over...=back Regions" の節に あります。 フォーマッティングコードは展開されません。 例:

  =over 3

  =over 3.5

  =over
"=item"

This command indicates that an item in a list begins here. Formatting codes are processed. The semantics of the (optional) text in the remainder of this paragraph are explained in the "About =over...=back Regions" section, further below. Examples:

このコマンドは、ここからリストの中のアイテムが始まることを示します。 フォーマッティングコードは処理されます。 この段落の(オプションである)残りのテキストの意味論はかなり後ろの "About =over...=back Regions" の節にあります。 例:

  =item

  =item *

  =item      *    

  =item 14

  =item   3.

  =item C<< $thing->stuff(I<dodad>) >>

  =item For transporting us beyond seas to be tried for pretended
  offenses

  =item He is at this time transporting large armies of foreign
  mercenaries to complete the works of death, desolation and
  tyranny, already begun with circumstances of cruelty and perfidy
  scarcely paralleled in the most barbarous ages, and totally
  unworthy the head of a civilized nation.
"=back"

This command indicates that this is the end of the region begun by the most recent "=over" command. It permits no text after the "=back" command.

このコマンドは、ここがもっとも近い位置の "=over" コマンドで始まった領域の 終わりであることを示します。 "=back" コマンドの後にテキストを置くことは許されません。

"=begin formatname"
"=begin formatname parameter"

This marks the following paragraphs (until the matching "=end formatname") as being for some special kind of processing. Unless "formatname" begins with a colon, the contained non-command paragraphs are data paragraphs. But if "formatname" does begin with a colon, then non-command paragraphs are ordinary paragraphs or data paragraphs. This is discussed in detail in the section "About Data Paragraphs and "=begin/=end" Regions".

これは、引き続く段落 (マッチングする "=end formatname" まで) が なんらかの特殊な処理をするためのものであることを示します。 "formatname" がコロンで始まっていなければ、含まれている非コマンド段落は データ段落です。 しかし、もし "formatname" がコロンで 始まっている なら、非コマンド段落は 通常の段落かデータ段落です。 これは "About Data Paragraphs and "=begin/=end" Regions" の節で詳しく 議論しています。

It is advised that formatnames match the regexp m/\A:?[-a-zA-Z0-9_]+\z/. Everything following whitespace after the formatname is a parameter that may be used by the formatter when dealing with this region. This parameter must not be repeated in the "=end" paragraph. Implementors should anticipate future expansion in the semantics and syntax of the first parameter to "=begin"/"=end"/"=for".

formatname は正規表現 m/\A:?[-a-zA-Z0-9_]+\z/ にマッチングすることを 勧めます。 formatname の後ろの空白に引き続く全てのものは、フォーマッタがこの 領域を扱うときに使われるかも知れないパラメータです。 このパラメータは "=end" 段落では繰り返されてはいけません(must not)。 実装者は "=begin"/"=end"/"=for" の最初の引数の意味論と文法の将来の拡張に 備えるべきです(should)。

"=end formatname"

This marks the end of the region opened by the matching "=begin formatname" region. If "formatname" is not the formatname of the most recent open "=begin formatname" region, then this is an error, and must generate an error message. This is discussed in detail in the section "About Data Paragraphs and "=begin/=end" Regions".

これはマッチングする "=begin formatname" 領域によって開かれた領域の 終わりを示します。 "formatname" が直近に開かれた "=begin formatname" 領域の formatname では ない場合、これはエラーであり、エラーメッセージを 生成しなければなりません(must)。 これは "About Data Paragraphs and "=begin/=end" Regions" の節で詳しく 議論しています。

"=for formatname text..."

This is synonymous with:

これは以下と同等です:

     =begin formatname

     text...

     =end formatname

That is, it creates a region consisting of a single paragraph; that paragraph is to be treated as a normal paragraph if "formatname" begins with a ":"; if "formatname" doesn't begin with a colon, then "text..." will constitute a data paragraph. There is no way to use "=for formatname text..." to express "text..." as a verbatim paragraph.

つまり、これは単一の段落からなる領域を作成します; この段落は、 "formatname" が ":" で始まっているなら通常の段落として扱われます; "formatname" がコロンで 始まっていない なら、"text..." は データ段落を構成します。 "text..." をそのままの段落として記述するために "=for formatname text..." を 使う方法はありません。

"=encoding encodingname"

This command, which should occur early in the document (at least before any non-US-ASCII data!), declares that this document is encoded in the encoding encodingname, which must be an encoding name that Encode recognizes. (Encode's list of supported encodings, in Encode::Supported, is useful here.) If the Pod parser cannot decode the declared encoding, it should emit a warning and may abort parsing the document altogether.

このコマンドは(文書の最初の方に(少なくとも非 US-ASCII データが出てくる 前に!)書くべきです(should))、この文書がエンコーディング encodingname で エンコードされていることを宣言します; これは Encode が認識する エンコーディングでなければなりません(must)。 (Encode::Supported にある、Encode が対応するエンコーディングの一覧が 便利です。) Pod パーサが宣言されたエンコーディングでデコードできない場合は、 警告を出力するべき(should)で、文書のパースを中断してもかまいません(may)。

A document having more than one "=encoding" line should be considered an error. Pod processors may silently tolerate this if the not-first "=encoding" lines are just duplicates of the first one (e.g., if there's a "=encoding utf8" line, and later on another "=encoding utf8" line). But Pod processors should complain if there are contradictory "=encoding" lines in the same document (e.g., if there is a "=encoding utf8" early in the document and "=encoding big5" later). Pod processors that recognize BOMs may also complain if they see an "=encoding" line that contradicts the BOM (e.g., if a document with a UTF-16LE BOM has an "=encoding shiftjis" line).

複数の "=encoding" 行を持つ文書はエラーとして扱われるべきです(should)。 Pod プロセッサは、最初以外の "=encoding" 行が最初のものと同じ場合 (例えば、"=encoding utf8" 行があって、その後また "=encoding utf8" 行が あった場合)は黙って許容してもかまいません(may)。 しかし Pod プロセッサは、同じ文書に矛盾する "=encoding" 行がある場合 (例えば、文書の最初の方に "=encoding utf8" があって、その後 "=encoding big5" 行があった場合) エラーにするべきです(should)。 BOM を認識する Pod プロセッサは、BOM と矛盾する "=encoding" 行がある場合 (例えば、文書が UTF-16LE BOM で始まっていて "=encoding shiftjis" 行がある 場合)、エラーにしてもかまいません(may)。

If a Pod processor sees any command other than the ones listed above (like "=head", or "=haed1", or "=stuff", or "=cuttlefish", or "=w123"), that processor must by default treat this as an error. It must not process the paragraph beginning with that command, must by default warn of this as an error, and may abort the parse. A Pod parser may allow a way for particular applications to add to the above list of known commands, and to stipulate, for each additional command, whether formatting codes should be processed.

Pod プロセッサが上に示した以外のコマンド ("=head", "=haed1", "=stuff", "=cuttlefish", "=w123" など)に遭遇した場合、プロセッサはデフォルトでは エラーとして扱わなければなりません(must)。 このようなコマンドで始まる段落を処理してはならず(must not)、デフォルトでは エラーとして警告しなければならず(must)、パースを 中断してもかまいません(may)。 Pod パーサは、特定のアプリケーションのために、上述の既知のコマンドの一覧に 追加して、それぞれの追加コマンドに対して、フォーマッティングコードを 処理するかどうかを規定する方法を認めてもかまいません(may)。

Future versions of this specification may add additional commands.

この仕様の将来のバージョンでは追加のコマンドが追加されるかもしれません。

Pod フォーマッティングコード

(Note that in previous drafts of this document and of perlpod, formatting codes were referred to as "interior sequences", and this term may still be found in the documentation for Pod parsers, and in error messages from Pod processors.)

(この文書の以前の草案と以前の perlpod では、フォーマッティングコードは 「内部シーケンス」(interior sequences) として参照されていて、 この用語は Pod パーサの文書や、Pod プロセッサのエラーメッセージに まだ残っていることに注意してください。)

There are two syntaxes for formatting codes:

フォーマッティングコードには二つの文法があります:

  • A formatting code starts with a capital letter (just US-ASCII [A-Z]) followed by a "<", any number of characters, and ending with the first matching ">". Examples:

    英大文字 (ちょうど US-ASCII [A-Z]) で始まり、次に "<"、その次に 任意の数の文字が続き、最初にマッチングする ">" で終わる フォーマッティングコード。 例:

        That's what I<you> think!
    
        What's C<CORE::dump()> for?
    
        X<C<chmod> and C<unlink()> Under Different Operating Systems>
  • A formatting code starts with a capital letter (just US-ASCII [A-Z]) followed by two or more "<"'s, one or more whitespace characters, any number of characters, one or more whitespace characters, and ending with the first matching sequence of two or more ">"'s, where the number of ">"'s equals the number of "<"'s in the opening of this formatting code. Examples:

    英大文字 (ちょうど US-ASCII [A-Z]) で始まり、2 個以上の "<"、 1 個以上の空白文字、任意の数の文字、1 個以上の空白文字が続き、 このフォーマッティングコードの最初にあった "<" と同じ数の ">" で 終わるフォーマッティングコード。 例:

        That's what I<< you >> think!
    
        C<<< open(X, ">>thing.dat") || die $! >>>
    
        B<< $foo->bar(); >>

    With this syntax, the whitespace character(s) after the "C<<<" and before the ">>>" (or whatever letter) are not renderable. They do not signify whitespace, are merely part of the formatting codes themselves. That is, these are all synonymous:

    この文法では、"C<<<" の後ろと ">>>" (やその他の文字) の前の空白文字は レンダリング されません 。 空白は認識せず、単にフォーマッティングコード自身の一部となります。 つまり、以下のものは全て同じ意味です:

        C<thing>
        C<< thing >>
        C<<           thing     >>
        C<<<   thing >>>
        C<<<<
        thing
                   >>>>

    and so on.

    および同様なものです。

    Finally, the multiple-angle-bracket form does not alter the interpretation of nested formatting codes, meaning that the following four example lines are identical in meaning:

    最後に、複数山かっこ形式はネストしたフォーマッティングコードの解釈を 変更 しません; つまり、以下の四つの例は意味としては同じです:

      B<example: C<$a E<lt>=E<gt> $b>>
    
      B<example: C<< $a <=> $b >>>
    
      B<example: C<< $a E<lt>=E<gt> $b >>>
    
      B<<< example: C<< $a E<lt>=E<gt> $b >> >>>

In parsing Pod, a notably tricky part is the correct parsing of (potentially nested!) formatting codes. Implementors should consult the code in the parse_text routine in Pod::Parser as an example of a correct implementation.

Pod をパースするときに特にトリッキーな部分は、(ネストしているかもしれない!) フォーマッティングコードを正しくパースすることです。 実装者は正しい実装の例として、Pod::Parsar の parse_text ルーチンの コードを参考にするべきです。

I<text> -- italic text

(I<text> -- イタリック文字)

See the brief discussion in "Formatting Codes" in perlpod.

"Formatting Codes" in perlpod にある簡潔な議論を参照してください。

B<text> -- bold text

(B<text> -- ボールド文字)

See the brief discussion in "Formatting Codes" in perlpod.

"Formatting Codes" in perlpod にある簡潔な議論を参照してください。

C<code> -- code text

(C<code> -- コード文字)

See the brief discussion in "Formatting Codes" in perlpod.

"Formatting Codes" in perlpod にある簡潔な議論を参照してください。

F<filename> -- style for filenames

(F<filename> -- ファイル名用のスタイル)

See the brief discussion in "Formatting Codes" in perlpod.

"Formatting Codes" in perlpod にある簡潔な議論を参照してください。

X<topic name> -- an index entry

(X<topic name> -- インデックスエントリ)

See the brief discussion in "Formatting Codes" in perlpod.

"Formatting Codes" in perlpod にある簡潔な議論を参照してください。

This code is unusual in that most formatters completely discard this code and its content. Other formatters will render it with invisible codes that can be used in building an index of the current document.

このコードは特殊で、ほとんどのフォーマッタはこのコードとその内容は 完全に捨てられます。 その他のフォーマッタは現在の文書のインデックス構築に使える 見えないコードとしてレンダリングされます。

Z<> -- a null (zero-effect) formatting code

Discussed briefly in "Formatting Codes" in perlpod.

"Formatting Codes" in perlpod で簡潔に議論されています。

This code is unusual in that it should have no content. That is, a processor may complain if it sees Z<potatoes>. Whether or not it complains, the potatoes text should ignored.

このコードは特殊で、内容はなしであるべきです(should)。 つまり、プロセッサが Z<potatoes> を見ると異常とみなしても かまいません(may)。 異常とみなすかどうかに関わらず、potatoes という文字は 無視されるべきです(should)。

L<name> -- a hyperlink

(L<name> -- ハイパーリンク)

The complicated syntaxes of this code are discussed at length in "Formatting Codes" in perlpod, and implementation details are discussed below, in "About L<...> Codes". Parsing the contents of L<content> is tricky. Notably, the content has to be checked for whether it looks like a URL, or whether it has to be split on literal "|" and/or "/" (in the right order!), and so on, before E<...> codes are resolved.

このコードの複雑な文法は "Formatting Codes" in perlpod で詳細に 議論されていて、実装の詳細は後述する "About L<...> Codes" に あります。 L<content> の内容のパースはトリッキーです。 特に、E<...> コードが解決される 前に 、 内容が URL のように見えるか、あるいは内容が "|" や "/" で 分割する必要があるか (右順序で!) などです。

E<escape> -- a character escape

(E<escape> -- 文字エスケープ)

"Formatting Codes" in perlpod と、 "Notes on Implementing Pod Processors" にあるいくつかのポイントを 参照してください。

S<text> -- text contains non-breaking spaces

(S<text> -- ノーブレークスペースを含む文字列)

This formatting code is syntactically simple, but semantically complex. What it means is that each space in the printable content of this code signifies a non-breaking space.

このフォーマッティングコードは文法的には単純ですが、意味論的には複雑です。 これが意味することは、このコードの内容にあるそれぞれのスペースは ノーブレークスペースとして認識されるということです。

Consider:

以下のものを考えます:

    C<$x ? $y    :  $z>

    S<C<$x ? $y     :  $z>>

Both signify the monospace (c[ode] style) text consisting of "$x", one space, "?", one space, ":", one space, "$z". The difference is that in the latter, with the S code, those spaces are not "normal" spaces, but instead are non-breaking spaces.

どちらも "$x"、一つのスペース、"?"、一つのスペース、":"、一つのスペース、 "$z" からなる、固定幅 (コードスタイル) 文字列として認識されます。 違いは、S コードの付いている後者は、これらのスペースは「普通の」 スペースではなく、ノーブレークスペースであるということです。

If a Pod processor sees any formatting code other than the ones listed above (as in "N<...>", or "Q<...>", etc.), that processor must by default treat this as an error. A Pod parser may allow a way for particular applications to add to the above list of known formatting codes; a Pod parser might even allow a way to stipulate, for each additional command, whether it requires some form of special processing, as L<...> does.

Pod プロセッサが ("N<...>" や "Q<...>" のような) 上述のもの 以外のフォーマットコードに出会った場合、プロセッサはデフォルトでは エラーとして扱わなければなりません (must)。 Pod パーサは、特定のアプリケーションのために、上述の既知のフォーマッティング コードの一覧に追加する方法を認めてもかまいません(may); Pod パーサは追加されたコマンドそれぞれに対して、L<...> が しているように、特殊処理のためのある種の形式を要求するかどうかを 規定しているかもしれません。

Future versions of this specification may add additional formatting codes.

この仕様の将来のバージョンでは追加のフォーマッティングコードが 追加されるかもしれません。

Historical note: A few older Pod processors would not see a ">" as closing a "C<" code, if the ">" was immediately preceded by a "-". This was so that this:

ヒストリカルノート: いくつかの古い Pod プロセッサは、"-" の直後にある ">" を、閉じ "C<" コードとして扱いません。 これにより、以下のようなものが:

    C<$foo->bar>

would parse as equivalent to this:

以下のものと等価として扱われ:

    C<$foo-E<gt>bar>

instead of as equivalent to a "C" formatting code containing only "$foo-", and then a "bar>" outside the "C" formatting code. This problem has since been solved by the addition of syntaxes like this:

"$foo-" だけが含まれる "C" フォーマッティングコードの後 "C" フォーマッティングコード の外にある "bar>"、と等価にはなりません。 この問題は以下のような文法の追加によって解決されました:

    C<< $foo->bar >>

Compliant parsers must not treat "->" as special.

準拠しているパーサは "->" を特別扱いしてはいけません (must not)。

Formatting codes absolutely cannot span paragraphs. If a code is opened in one paragraph, and no closing code is found by the end of that paragraph, the Pod parser must close that formatting code, and should complain (as in "Unterminated I code in the paragraph starting at line 123: 'Time objects are not...'"). So these two paragraphs:

フォーマッティングコードは絶対に段落をまたげません。 もしコードがある段落で開き、その段落の終わりまでに閉じコードがない場合、 Pod パーサはフォーマッティングを閉じなければならず(must)、 また ("Unterminated I code in the paragraph starting at line 123: 'Time objects are not...'" のような) エラーを出力するべきです (should)。 従って、これら二つの段落は:

  I<I told you not to do this!

  Don't make me say it again!>

...must not be parsed as two paragraphs in italics (with the I code starting in one paragraph and starting in another.) Instead, the first paragraph should generate a warning, but that aside, the above code must parse as if it were:

(I コードが一つ目の段落から始まって次の段落でも始まっているという形で) 二つの段落をイタリックとしてパース してはいけません(must not)。 代わりに、最初の段落は警告を生成するべきです(should)ですが、それを 置いておいて、上述のコードは以下のようであるかのように パースしなければなりません(must):

  I<I told you not to do this!>

  Don't make me say it again!E<gt>

(In SGMLish jargon, all Pod commands are like block-level elements, whereas all Pod formatting codes are like inline-level elements.)

(SGML 的な jargon で言うなら、全ての Pod コマンドはブロックレベル要素の ようなもので、一方全ての Pod フォーマッティングコードはインライン要素の ようなものです。)

Pod プロセッサの実装に関するメモ

The following is a long section of miscellaneous requirements and suggestions to do with Pod processing.

以下は、Pod の処理を行うためのさまざまな要求と提案の長いリストです。

  • Pod formatters should tolerate lines in verbatim blocks that are of any length, even if that means having to break them (possibly several times, for very long lines) to avoid text running off the side of the page. Pod formatters may warn of such line-breaking. Such warnings are particularly appropriate for lines are over 100 characters long, which are usually not intentional.

    Pod フォーマッタは、たとえテキストがページからはみ出すのを避けるために (とても長い行に対しては複数回)分割しないといけないとしても、 任意の長さのそのままのブロックの行を許容するべきです(should)。 Pod フォーマッタはそのような行分割に対して警告を出してもかまいません(may)。 この警告は特に、(普通は意図したものではない) 100 文字以上の行に対して 出すのが適切です。

  • Pod parsers must recognize all of the three well-known newline formats: CR, LF, and CRLF. See perlport.

    Pod パーサは 3 種類のよく知られた改行 (CR, LF, CRLF) の 全て を 認識しなければなりません(must)。 perlport を参照してください。

  • Pod parsers should accept input lines that are of any length.

    Pod パーサは任意の長さの入力行を受け付けるべきです(should)。

  • Since Perl recognizes a Unicode Byte Order Mark at the start of files as signaling that the file is Unicode encoded as in UTF-16 (whether big-endian or little-endian) or UTF-8, Pod parsers should do the same. Otherwise, the character encoding should be understood as being UTF-8 if the first highbit byte sequence in the file seems valid as a UTF-8 sequence, or otherwise as CP-1252 (earlier versions of this specification used Latin-1 instead of CP-1252).

    Perl は、ファイルの先頭に付けることでファイルが UTF-16 (ビッグエンディアンかリトルエンディアンか)あるいは UTF-8 かを 示すためにファイルの先頭に付けるバイト順マーク(Byte Order Mark)を 認識するので、Pod パーサも同様であるべきです(should)。 さもなければ、ファイル中の最初の最上位ビットの立ったバイトシーケンスが UTF-8 シーケンスとして有効であるように見える場合は文字エンコーディング UTF-8 と、そうでなければ CP-1252 と認識するべきです(should) (この仕様の以前の版では CP-1252 ではなく Latin-1 を使っていました)。

    Future versions of this specification may specify how Pod can accept other encodings. Presumably treatment of other encodings in Pod parsing would be as in XML parsing: whatever the encoding declared by a particular Pod file, content is to be stored in memory as Unicode characters.

    この仕様の将来のバージョンでは Pod がその他のエンコーディングをどのように 受け入れるかが指定されるかもしれません。 おそらく Pod パース中のその他のエンコーディングの扱いは XML のパースと 同じようになるでしょう: 特定の Pod ファイルでどのエンコーディングが 宣言されたとしても、内容は Unicode 文字としてメモリに補完されます。

  • The well known Unicode Byte Order Marks are as follows: if the file begins with the two literal byte values 0xFE 0xFF, this is the BOM for big-endian UTF-16. If the file begins with the two literal byte value 0xFF 0xFE, this is the BOM for little-endian UTF-16. On an ASCII platform, if the file begins with the three literal byte values 0xEF 0xBB 0xBF, this is the BOM for UTF-8. A mechanism portable to EBCDIC platforms is to:

    よく知られているバイト順マークには以下のものがあります: もしファイルが二つのリテラルバイト値 0xFE 0xFF で始まっているなら、 これはビッグエンディアン UTF-16 の BOM です。 もしファイルが二つのリテラルバイト値 0xFF 0xFE で始まっているなら、 これはリトルエンディアン UTF-16 の BOM です。 ASCII プラットフォームでは、もしファイルが三つのリテラルバイト値 0xEF 0xBB 0xBF で始まっているなら、これは UTF-8 の BOM です。 EBCDIC プラットフォームと移植性のある機構は:

      my $utf8_bom = "\x{FEFF}";
      utf8::encode($utf8_bom);
  • A naive, but often sufficient heuristic on ASCII platforms, for testing the first highbit byte-sequence in a BOM-less file (whether in code or in Pod!), to see whether that sequence is valid as UTF-8 (RFC 2279) is to check whether that the first byte in the sequence is in the range 0xC2 - 0xFD and whether the next byte is in the range 0x80 - 0xBF. If so, the parser may conclude that this file is in UTF-8, and all highbit sequences in the file should be assumed to be UTF-8. Otherwise the parser should treat the file as being in CP-1252. (A better check, and which works on EBCDIC platforms as well, is to pass a copy of the sequence to utf8::decode() which performs a full validity check on the sequence and returns TRUE if it is valid UTF-8, FALSE otherwise. This function is always pre-loaded, is fast because it is written in C, and will only get called at most once, so you don't need to avoid it out of performance concerns.) In the unlikely circumstance that the first highbit sequence in a truly non-UTF-8 file happens to appear to be UTF-8, one can cater to our heuristic (as well as any more intelligent heuristic) by prefacing that line with a comment line containing a highbit sequence that is clearly not valid as UTF-8. A line consisting of simply "#", an e-acute, and any non-highbit byte, is sufficient to establish this file's encoding.

    並びが有効な UTF-8 (RFC 2279) かどうかを見るための、 BOM なしファイルの(コード内か POD内内かに関わらず)最初の最上位ビットが 立ったバイト並びをテストするという単純だけれども ASCII プラットフォームでは 十分な発見法は、並びの最初のバイトが 0xC2 - 0xFD の範囲 かつ 次のバイトの 範囲が 0x80 - 0xBF であるかどうかを調べることです。 もしそうなら、パーサはこのファイルが UTF-8 で、そのファイルの全ての 最上位ビットが立った並びが UTF-8 であると結論づけてもかまいません(may)。 さもなければパーサはそのファイルを CP-1252 として扱うべきです (should)。 (より良く、EBCDIC プラットフォームでも動作するチェックは、 並びのコピーを utf8::decode() に渡すことで、これは並びの 完全な正当性チェックを実行し、これが有効な UTF-8 なら TRUE を、さもなければ FALSE を返します。 この関数は常に事前読み込みされ、C で書かれているので高速で、 最大でも 1 回だけしか呼び出されないので、性能を考慮してこれを避ける 必要はありません。) 真に 非 UTF-8 のファイルの最初の最上位ビットが立った並びがたまたま UTF-8 に見えるというのはありそうにない状況なので、明確に UTF-8 として 有効 ではない、最上位ビットが立った並びを含むコメント行を置くことで 我々のヒューリスティック(およびさらに賢いヒューリスティック)を 満たすことができます。 単なる "#"、鋭アクセント e、最上位ビットが立っていないバイト、からなる 行は、このファイルのエンコーディングを決定するのに十分です。

  • Pod processors must treat a "=for [label] [content...]" paragraph as meaning the same thing as a "=begin [label]" paragraph, content, and an "=end [label]" paragraph. (The parser may conflate these two constructs, or may leave them distinct, in the expectation that the formatter will nevertheless treat them the same.)

    Pod プロセッサは、"=for [label] [content...]" 段落を、 "=begin [label]" 段落、内容、"=end [label]" 段落と同じように 扱わなければなりません(must)。 (パーサはこれら二つの構文を融合してもかまいません(may)し、別々のままに してもかまいません(may); フォーマッタはどちらにしても同じように扱います。)

  • When rendering Pod to a format that allows comments (i.e., to nearly any format other than plaintext), a Pod formatter must insert comment text identifying its name and version number, and the name and version numbers of any modules it might be using to process the Pod. Minimal examples:

    Pod を、コメントが許されるフォーマット (つまり、ほぼ、プレーンテキスト以外の あらゆるフォーマット) にレンダリングするとき、 Pod フォーマッタは、自身の名前とバージョン番号、および Pod を 処理するときに使った全てのモジュールの名前とバージョン番号が識別できる コメントを挿入しなければなりません(must)。 最小限の例:

     %% POD::Pod2PS v3.14159, using POD::Parser v1.92
    
     <!-- Pod::HTML v3.14159, using POD::Parser v1.92 -->
    
     {\doccomm generated by Pod::Tree::RTF 3.14159 using Pod::Tree 1.08}
    
     .\" Pod::Man version 3.14159, using POD::Parser version 1.92

    Formatters may also insert additional comments, including: the release date of the Pod formatter program, the contact address for the author(s) of the formatter, the current time, the name of input file, the formatting options in effect, version of Perl used, etc.

    フォーマッタは、Pod フォーマッタプログラムのリリース日、フォーマッタの 作者への連絡アドレス、現在時刻、入力ファイル名、適用された フォーマットオプション、使われた Perl のバージョンといった 追加のコメントを挿入してもかまいません(may)。

    Formatters may also choose to note errors/warnings as comments, besides or instead of emitting them otherwise (as in messages to STDERR, or dieing).

    フォーマッタは、エラー/警告を、(STDERR へのメッセージや die として) その他の場所への出力に加えて、またはそれに代えて、コメントとして 記録することを選択してもかまいません(may)。

  • Pod parsers may emit warnings or error messages ("Unknown E code E<zslig>!") to STDERR (whether through printing to STDERR, or warning/carping, or dieing/croaking), but must allow suppressing all such STDERR output, and instead allow an option for reporting errors/warnings in some other way, whether by triggering a callback, or noting errors in some attribute of the document object, or some similarly unobtrusive mechanism -- or even by appending a "Pod Errors" section to the end of the parsed form of the document.

    Pod パーサは警告やエラーメッセージ ("Unknown E code E<zslig>!") を (STDERR に print するか warncarp を使うか diecroak を 使うかに関わらず) STDERR に出力しても かまいません (may) が、 そのような全ての STDERR 出力を抑制して、代わりに、コールバックを 引き起こすことによってか、エラーを文書オブジェクトの何らかの属性または 同様の控えめな機構によって記録するか、あるいは文書のパースされた形式の 末尾に "Pod Errors" 節を追加する方法でも、何らかの他の方法でエラー/警告を 報告するためのオプションを認めなければなりません(must)。

  • In cases of exceptionally aberrant documents, Pod parsers may abort the parse. Even then, using dieing/croaking is to be avoided; where possible, the parser library may simply close the input file and add text like "*** Formatting Aborted ***" to the end of the (partial) in-memory document.

    極端に異常な文書の場合は、Pod パーサはパースを中断してもかまいません(may)。 それでも、die/croak の使用は避けます; 可能なら、パーサは単に 入力ファイルを閉じて、メモリにある文書(の一部)の末尾に "*** Formatting Aborted ***" のような文章を追加してもかまいません(may)。

  • In paragraphs where formatting codes (like E<...>, B<...>) are understood (i.e., not verbatim paragraphs, but including ordinary paragraphs, and command paragraphs that produce renderable text, like "=head1"), literal whitespace should generally be considered "insignificant", in that one literal space has the same meaning as any (nonzero) number of literal spaces, literal newlines, and literal tabs (as long as this produces no blank lines, since those would terminate the paragraph). Pod parsers should compact literal whitespace in each processed paragraph, but may provide an option for overriding this (since some processing tasks do not require it), or may follow additional special rules (for example, specially treating period-space-space or period-newline sequences).

    (E<...>, B<...> のような)フォーマッティングコードを理解する 段落 (つまり、そのままの段落は 含みません が、通常の段落および "=head1" のようなレンダリングされるテキストを出力するコマンド段落を 含みます)では、リテラルな空白は一般的に「重要でない」と 考えられるべきです(should); 一つのリテラルな空白は任意の(非 0 の) 数のリテラルな空白、リテラルな改行、リテラルなタブは (これにより空行(これは段落の終わりになるので)を出力しない限り)、 同じ意味になります。 Pod パーサはそれ園れの処理された段落でのリテラルな空白を 詰めるべきです(should)が、(いくつかの処理タスクはこれを必要としないので)、 これを上書きするオプションを提供してもかまいません(may)し、 追加の特殊ルール(例えば、ピリオド-空白-空白やピリオド-改行の並びを 特別扱いするなど)に従ってもかまいません(may)。

  • Pod parsers should not, by default, try to coerce apostrophe (') and quote (") into smart quotes (little 9's, 66's, 99's, etc), nor try to turn backtick (`) into anything else but a single backtick character (distinct from an open quote character!), nor "--" into anything but two minus signs. They must never do any of those things to text in C<...> formatting codes, and never ever to text in verbatim paragraphs.

    Pod パーサはデフォルトでは、アポストロフィ (') とクォート (") を スマートクォート (小さい 9's, 66's, 99's, など)にしようとしたり、 逆クォート (`) を(開きクォート文字と区別するために!)単一の 逆クォート文字以外に変えようとしたり、"--" を二つのマイナス記号以外に 変えようとするべきではありません(should not)。 これらを C<...> 中のテキストには 決して 行っては いけません(must not)し、そのままの段落のテキストには 決して決して 行ってはいけません(must not)。

  • When rendering Pod to a format that has two kinds of hyphens (-), one that's a non-breaking hyphen, and another that's a breakable hyphen (as in "object-oriented", which can be split across lines as "object-", newline, "oriented"), formatters are encouraged to generally translate "-" to non-breaking hyphen, but may apply heuristics to convert some of these to breaking hyphens.

    Pod を、改行なしのハイフン (-) と改行可能なハイフン ("object-oriented" のようなときに、"object-"、改行、"oriented" と 分割できるもの) の 2 種類があるフォーマットにレンダリングするときは、 フォーマッタは一般的に "-" を改行なしのハイフンに変換することが 推奨されますが、これらの一部を改行するハイフンに変換するための 発見的手法を適用してもかまいません(may)。

  • Pod formatters should make reasonable efforts to keep words of Perl code from being broken across lines. For example, "Foo::Bar" in some formatting systems is seen as eligible for being broken across lines as "Foo::" newline "Bar" or even "Foo::-" newline "Bar". This should be avoided where possible, either by disabling all line-breaking in mid-word, or by wrapping particular words with internal punctuation in "don't break this across lines" codes (which in some formats may not be a single code, but might be a matter of inserting non-breaking zero-width spaces between every pair of characters in a word.)

    Pod フォーマッタは、Perl コードの単語が行をまたがないように合理的な努力を 行うべきです(should)。 例えば、一部のフォーマッティングシステムでの"Foo::Bar" は、 "Foo::" 改行 "Bar" や、"Foo::-" 改行 "Bar" のように行をまたいで 分割しても有効です。 これは、可能なところでは、単語の途中での全ての行分割を無効にするか、 特定の単語を「これは行をまたがない」コードの内部的な句読点 (一部のフォーマットでは単一のコードではなく、非分割ゼロ幅空白を単語の文字の それぞれの組の間に挿入するという形かもしれません)で包むことで 防ぐべきです(should)。

  • Pod parsers should, by default, expand tabs in verbatim paragraphs as they are processed, before passing them to the formatter or other processor. Parsers may also allow an option for overriding this.

    Pod パーサは、デフォルトでは、フォーマッタやその他のプロセッサに 渡す前に、そのままの段落のタブを展開するべきです(should)。 パーサはこれを上書きするオプションを許してもかまいません(may)。

  • Pod parsers should, by default, remove newlines from the end of ordinary and verbatim paragraphs before passing them to the formatter. For example, while the paragraph you're reading now could be considered, in Pod source, to end with (and contain) the newline(s) that end it, it should be processed as ending with (and containing) the period character that ends this sentence.

    Pod パーサは、デフォルトでは、通常の段落とそのままの段落の末尾の 改行を、フォーマッタに渡す前に削除するべきです(should)。 例えば、今読み込んでいる段落が Pod ソースでは空行を含んでいて、 それで終わっていると考えられる一方、 この文を終わらせるピリオド文字を含んでいて、それで終わっているかのように 処理するべきです(should)。

  • Pod parsers, when reporting errors, should make some effort to report an approximate line number ("Nested E<>'s in Paragraph #52, near line 633 of Thing/Foo.pm!"), instead of merely noting the paragraph number ("Nested E<>'s in Paragraph #52 of Thing/Foo.pm!"). Where this is problematic, the paragraph number should at least be accompanied by an excerpt from the paragraph ("Nested E<>'s in Paragraph #52 of Thing/Foo.pm, which begins 'Read/write accessor for the C<interest rate> attribute...'").

    Pod パーサは、エラーを報告するときは、単に段落番号を報告する ("Nested E<>'s in Paragraph #52 of Thing/Foo.pm!") のではなく、 およその行番号を報告するための 努力を行うべきです ("Nested E<>'s in Paragraph #52, near line 633 of Thing/Foo.pm!")(should)。 これが難しいところでは、段落番号は少なくとも段落の抜粋と共に 報告されるべきです ("Nested E<>'s in Paragraph #52 of Thing/Foo.pm, which begins 'Read/write accessor for the C<interest rate> attribute...'")(should)。

  • Pod parsers, when processing a series of verbatim paragraphs one after another, should consider them to be one large verbatim paragraph that happens to contain blank lines. I.e., these two lines, which have a blank line between them:

    Pod パーサは、連続したそのままの段落を処理するときには、たまたま空行を 含んでいる大きな一つのそのままの段落として扱うべきです(should)。 つまり、以下のような、空行を挟んだ 2 つの行は:

            use Foo;
    
            print Foo->VERSION

    should be unified into one paragraph ("\tuse Foo;\n\n\tprint Foo->VERSION") before being passed to the formatter or other processor. Parsers may also allow an option for overriding this.

    フォーマッタや他のプロセッサに渡される前に一つの段落 ("\tuse Foo;\n\n\tprint Foo->VERSION") 統合されるべきです(should)。 パーサはこれを上書きするオプションを許してもかまいません(may)。

    While this might be too cumbersome to implement in event-based Pod parsers, it is straightforward for parsers that return parse trees.

    これはイベントベースの Pod パーサを実装するには厄介すぎるかもしれない一方、 パース木を返すパーサにとっては直感的です。

  • Pod formatters, where feasible, are advised to avoid splitting short verbatim paragraphs (under twelve lines, say) across pages.

    Pod フォーマッタは、可能なところでは、短いそのままの段落 (例えば 12 行 以下) がページをまたぐことを避けるように勧めます。

  • Pod parsers must treat a line with only spaces and/or tabs on it as a "blank line" such as separates paragraphs. (Some older parsers recognized only two adjacent newlines as a "blank line" but would not recognize a newline, a space, and a newline, as a blank line. This is noncompliant behavior.)

    Pod パーサは空白やタブだけからなる行を、段落を分割する「空行」として 扱わなければなりません(must)。 (一部の古いパーサは、二つの連続した改行のみを「空行」として認識し、 改行、空白、改行は空行として認識しません。 これは非準拠の振る舞いです。)

  • Authors of Pod formatters/processors should make every effort to avoid writing their own Pod parser. There are already several in CPAN, with a wide range of interface styles -- and one of them, Pod::Simple, comes with modern versions of Perl.

    Pod フォーマッタ/プロセッサの作者は、独自の Pod パーサを書くことを 避けるためにあらゆる努力を行うべきです(should)。 既に様々なインターフェーススタイルを持ったものがいくつか CPAN にあり -- その一つである Pod::Simple か最近のバージョンの Perl に同梱されています。

  • Characters in Pod documents may be conveyed either as literals, or by number in E<n> codes, or by an equivalent mnemonic, as in E<eacute> which is exactly equivalent to E<233>. The numbers are the Latin1/Unicode values, even on EBCDIC platforms.

    Pod 文書中の文字は、リテラル、E<n> コード、(E<233> と等価な E<eacute> のように) 等価なニーモニック、のいずれで伝達しても かまいません(may)。 数値は、EBCDIC プラットフォームでも Latin1/Unicode の値です。

    When referring to characters by using a E<n> numeric code, numbers in the range 32-126 refer to those well known US-ASCII characters (also defined there by Unicode, with the same meaning), which all Pod formatters must render faithfully. Characters whose E<> numbers are in the ranges 0-31 and 127-159 should not be used (neither as literals, nor as E<number> codes), except for the literal byte-sequences for newline (ASCII 13, ASCII 13 10, or ASCII 10), and tab (ASCII 9).

    E<n> 数値コードを使って文字を参照するとき、 よく知られている US-ASCII で参照されている範囲 32-126 の数値 (Unicode でも同じ意味で定義されいます) は、全ての Pod フォーマッタは 充実にレンダリングしなければなりません(must)。 E<> 数値が 0-31 と 127-159 の範囲の文字は、改行 (ASCII 13, ASCII 13 ASCII 10, ASCII 10 のいずれか)またはタブ (ASCII 9) のための リテラルなバイト並びを除いて、(リテラルとしてと E<number> コードとしての どちらとしても) 使われるべきではありません (should not)。

    Numbers in the range 160-255 refer to Latin-1 characters (also defined there by Unicode, with the same meaning). Numbers above 255 should be understood to refer to Unicode characters.

    範囲 160-255 の数値は Latin-1 文字 (Unicode でも同じ意味で 定義されています) を参照します。 255 を超える数値は Unicode 文字を参照していると理解するべきです(should)。

  • Be warned that some formatters cannot reliably render characters outside 32-126; and many are able to handle 32-126 and 160-255, but nothing above 255.

    一部のフォーマッタは 32-126 の範囲外の文字を確実にレンダリングすることが 出来ず、多くのフォーマッタは 32-126 と 160-255 は扱えるものの、 255 を超える文字は扱えないことを警告しておきます。

  • Besides the well-known "E<lt>" and "E<gt>" codes for less-than and greater-than, Pod parsers must understand "E<sol>" for "/" (solidus, slash), and "E<verbar>" for "|" (vertical bar, pipe). Pod parsers should also understand "E<lchevron>" and "E<rchevron>" as legacy codes for characters 171 and 187, i.e., "left-pointing double angle quotation mark" = "left pointing guillemet" and "right-pointing double angle quotation mark" = "right pointing guillemet". (These look like little "<<" and ">>", and they are now preferably expressed with the HTML/XHTML codes "E<laquo>" and "E<raquo>".)

    小なりと大なりを表すよく知られた "E<lt>" と "E<gt>" の他に、 Pod パーサは "/" (スラッシュ) のための "E<sol>" と "|" (垂直バー、 パイプ) のための "E<verbar>" を理解しなければなりません(must)。 Pod パーサはまた、"E<lchevron>" と "E<rchevron>" を 文字 171 と 187 の古いコードとして理解するべきです(should); つまり、 "left-pointing double angle quotation mark" = "left pointing guillemet" で、"right-pointing double angle quotation mark" = "right pointing guillemet" です。 (これらは小さい "<<" や ">>" のように見え、HTML/XHTML コードの "E<laquo>" や "E<raquo>" として表現されます。)

  • Pod parsers should understand all "E<html>" codes as defined in the entity declarations in the most recent XHTML specification at www.W3.org. Pod parsers must understand at least the entities that define characters in the range 160-255 (Latin-1). Pod parsers, when faced with some unknown "E<identifier>" code, shouldn't simply replace it with nullstring (by default, at least), but may pass it through as a string consisting of the literal characters E, less-than, identifier, greater-than. Or Pod parsers may offer the alternative option of processing such unknown "E<identifier>" codes by firing an event especially for such codes, or by adding a special node-type to the in-memory document tree. Such "E<identifier>" may have special meaning to some processors, or some processors may choose to add them to a special error report.

    Pod パーサは、www.W3.org にある最新の XHTML 仕様の実体宣言で 定義されている全ての "E<html>" コードを理解するべきです(should)。 Pod パーサは少なくとも範囲 160-255 (Latin-1) の文字を定義する エンティティを理解しなければなりません(must)。 Pod パーサは、不明な "E<identifier>" コードに出会ったとき、 (少なくともデフォルトでは)単にから文字列と置き換えるべきではなく (should not)、リテラル文字 E、小なり、identifier、大なりで構成される 文字列として渡されたものとしてもかまいません(may)。 または、Pod パーサは、そのような不明な "E<identifier>" コードを、 特にそのようなコードのためのイベントを起動するか、メモリ内文書木に 特別なノード型を追加することで処理する代替オプションを 提供してもかまいません(may)。 そのような "E<identifier>" は一部のプロセッサでは特別な意味を 持たせてもかまいませんし(may)、一部のプロセッサはこれを特別なエラー報告に 加えることを選んでもかまいません(may)。

  • Pod parsers must also support the XHTML codes "E<quot>" for character 34 (doublequote, "), "E<amp>" for character 38 (ampersand, &), and "E<apos>" for character 39 (apostrophe, ').

    Pod パーサは XHTML コードのうち、文字 34 (ダブルクォート, ") の ための "E<quot>"、文字 38 (アンパサンド, &) のための "E<amp>"、 文字 39 (アポストロフィ、 ') のための "E<apos>" にも 対応しなければなりません(must)。

  • Note that in all cases of "E<whatever>", whatever (whether an htmlname, or a number in any base) must consist only of alphanumeric characters -- that is, whatever must match m/\A\w+\z/. So "E< 0 1 2 3 >" is invalid, because it contains spaces, which aren't alphanumeric characters. This presumably does not need special treatment by a Pod processor; " 0 1 2 3 " doesn't look like a number in any base, so it would presumably be looked up in the table of HTML-like names. Since there isn't (and cannot be) an HTML-like entity called " 0 1 2 3 ", this will be treated as an error. However, Pod processors may treat "E< 0 1 2 3 >" or "E<e-acute>" as syntactically invalid, potentially earning a different error message than the error message (or warning, or event) generated by a merely unknown (but theoretically valid) htmlname, as in "E<qacute>" [sic]. However, Pod parsers are not required to make this distinction.

    "E<whatever>" 形式の全ての場合において、whatever (html 名でも どの基数の数値でも) は英数字のみから構成されていなければなりません(must) -- つまり、whateverm/\A\w+\z/ にマッチングしなければなりません。 つまり、"E< 0 1 2 3 >" は不正です; これには空白が含まれていて、 空白は英数字ではないからです。 これはおそらく Pod プロセッサによる特別扱いは 必要ありません; " 0 1 2 3 " はどの基数でも数値のようには見えないので、おそらく HTML 風の 名前のテーブルを探します。 " 0 1 2 3 " と呼ばれる HTML 風の実体はない(そしてあり得ない)ので、 これはエラーとして扱われます。 Pod プロセッサは "E< 0 1 2 3 >" や "E<e-acute>" を 文法的に 不正として扱って、単に "E<qacute>" (原文のまま) のような不明な(しかし 理論的には有効な)html として生成されるエラーメッセージ(または警告や イベント) とは異なるエラーメッセージを出力するかもしれません(may)。 しかし、Pod パーサはこの区別をすることを要求はされません。

  • Note that E<number> must not be interpreted as simply "codepoint number in the current/native character set". It always means only "the character represented by codepoint number in Unicode." (This is identical to the semantics of &#number; in XML.)

    E<number> は単に「現在の/ネイティブな文字集合における符号位置 number」と 扱ってはいけない (must not) ことに注意してください。 これは常に「Unicode で符号位置 number として表現される文字」という 意味しかありません。 (これは XML での &#number; の意味論と同じです。)

    This will likely require many formatters to have tables mapping from treatable Unicode codepoints (such as the "\xE9" for the e-acute character) to the escape sequences or codes necessary for conveying such sequences in the target output format. A converter to *roff would, for example know that "\xE9" (whether conveyed literally, or via a E<...> sequence) is to be conveyed as "e\\*'". Similarly, a program rendering Pod in a Mac OS application window, would presumably need to know that "\xE9" maps to codepoint 142 in MacRoman encoding that (at time of writing) is native for Mac OS. Such Unicode2whatever mappings are presumably already widely available for common output formats. (Such mappings may be incomplete! Implementers are not expected to bend over backwards in an attempt to render Cherokee syllabics, Etruscan runes, Byzantine musical symbols, or any of the other weird things that Unicode can encode.) And if a Pod document uses a character not found in such a mapping, the formatter should consider it an unrenderable character.

    これにより、おそらく多くのフォーマッタは Unicode 符号位置 (e-acute 文字のための "\xE9") からターゲット出力形式でそのような並びを 伝えるためのエスケープシーケンスやコードへのマッピングを行う表を 持つことを要求されます。 *roff の世界へのコンバータでは、例えば "\xE9" (リテラルか E<...> 並びかに関わらず) は "e\\*'" として伝えられます。 同様に、Mac OS アプリケーションウィンドウに Pod をレンダリングする プログラムはおそらく "\xE9" を、(これを書いている時点では) Mac OS に ネイティブな MacRoman エンコーディングの部号位置 142 に マッピングされることを知っている必要があります。 このような「Unicode から何か」へのマッピングはおそらく一般的な 出力形式については既に広く利用可能です。 (このようなマッピングは不完全かも知れません! 実装者は、チェロキー音節、エルトリア語のルーン、ビザンツの音楽記号、 その他 Unicode がエンコード出来る変なものをレンダリングしようとして 最大の努力をすることを想定しません。) そして、Pod 文書がこのようなマッピングにない文字が使うと、 フォーマッタはこれをレンダリングできない文字として扱うべきです(should)。

  • If, surprisingly, the implementor of a Pod formatter can't find a satisfactory pre-existing table mapping from Unicode characters to escapes in the target format (e.g., a decent table of Unicode characters to *roff escapes), it will be necessary to build such a table. If you are in this circumstance, you should begin with the characters in the range 0x00A0 - 0x00FF, which is mostly the heavily used accented characters. Then proceed (as patience permits and fastidiousness compels) through the characters that the (X)HTML standards groups judged important enough to merit mnemonics for. These are declared in the (X)HTML specifications at the www.W3.org site. At time of writing (September 2001), the most recent entity declaration files are:

    もし、驚くべきことに、Pod フォーマッタの実装者が、Unicode 文字から ターゲット形式のエスケープへのマッピングに関する、満足できる既に存在する 表(例えば Unicode 文字から *roff エスケープへのまともな表) を 発見できない場合、そのような表を構築する必要があります。 もしこのような状況にいるのなら、範囲 0x00A0 - 0x00FF の文字から 始めるべきです; これはほとんどアクセント付きの文字が使われます。 それから(忍耐が許して潔癖症が強いるなら)、(X)HTML 標準グループが、 省略形を作る価値があるほど重要であると判断した文字に進みます。 これらは www.W3.org のサイトの (X)HTML 定義で宣言されています。 これを書いている時点(2001 年 9 月)で、もっとも新しい実体定義ファイルは:

      http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent
      http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent
      http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent

    Then you can progress through any remaining notable Unicode characters in the range 0x2000-0x204D (consult the character tables at www.unicode.org), and whatever else strikes your fancy. For example, in xhtml-symbol.ent, there is the entry:

    それから範囲 0x2000-0x204D (www.unicode.org にある文字表を 参照してください)の残りの注目するべき Unicode 文字と、あなたの 興味を引いたものなんでもに進んでください。 例えば、xhtml-symbol.ent には、以下のようなエントリがあります:

      <!ENTITY infin    "&#8734;"> <!-- infinity, U+221E ISOtech -->

    While the mapping "infin" to the character "\x{221E}" will (hopefully) have been already handled by the Pod parser, the presence of the character in this file means that it's reasonably important enough to include in a formatter's table that maps from notable Unicode characters to the codes necessary for rendering them. So for a Unicode-to-*roff mapping, for example, this would merit the entry:

    "infin" から文字 "\x{221E}" へのマッピングは(できれば)既に Pod パーサによって 扱われている一方、このファイルにこの文字があるということは、 注目すべき Unicode 文字からそれをレンダリングするために必要なコードへの マッピングを行うフォーマッタの表に含めることが十分に合理的なほど 重要であることを意味します。 それで、例えば Unicode-to-*roff のマッピングのためには、これはエントリに 値します:

      "\x{221E}" => '\(in',

    It is eagerly hoped that in the future, increasing numbers of formats (and formatters) will support Unicode characters directly (as (X)HTML does with &infin;, &#8734;, or &#x221E;), reducing the need for idiosyncratic mappings of Unicode-to-my_escapes.

    将来、より多くの形式(とフォーマッタ)が((X)HTML が &infin;, &#8734;, &#x221E; で行うように) Unicode 文字を直接扱えるようになって、 Unicode-to-私のエスケープ への風変わりなマッピングの必要性が 減少することが熱望されています。

  • It is up to individual Pod formatter to display good judgement when confronted with an unrenderable character (which is distinct from an unknown E<thing> sequence that the parser couldn't resolve to anything, renderable or not). It is good practice to map Latin letters with diacritics (like "E<eacute>"/"E<233>") to the corresponding unaccented US-ASCII letters (like a simple character 101, "e"), but clearly this is often not feasible, and an unrenderable character may be represented as "?", or the like. In attempting a sane fallback (as from E<233> to "e"), Pod formatters may use the %Latin1Code_to_fallback table in Pod::Escapes, or Text::Unidecode, if available.

    レンダリングできない文字(これは、レンダリング出来るかどうかに関わらず パーサが解決できない、不明な E<thing> 並びとは異なります)に 直面したときに良い判断を表示するのは個々の Pod 次第です。 ("E<eacute>"/"E<233>" のような)ダイアクリティカルマーク付きの Latin 文字を、(単純な文字 101, "e" のような)対応するアクセントなしの US-ASCII 文字にマッピングするのはよいプラクティスですが、明らかに これはしばしば実行不可能で、レンダリングできない文字は "?" のようなもので 表現されるかもしれません(may)。 (E<233> から "e" のような) 健全なフォールバックのために、 Pod フォーマッタは、もし利用可能なら Pod::Escapes または Text::Unidecode にある %Latin1Code_to_fallback テーブルを つかってもかまいません(may)。

    For example, this Pod text:

    例えば、以下の Pod 文章:

      magic is enabled if you set C<$Currency> to 'E<euro>'.

    may be rendered as: "magic is enabled if you set $Currency to '?'" or as "magic is enabled if you set $Currency to '[euro]'", or as "magic is enabled if you set $Currency to '[x20AC]', etc.

    は、以下のようにレンダリングされるでしょう: "magic is enabled if you set $Currency to '?'" または "magic is enabled if you set $Currency to '[euro]'" または "magic is enabled if you set $Currency to '[x20AC]' など。

    A Pod formatter may also note, in a comment or warning, a list of what unrenderable characters were encountered.

    Pod フォーマッタは、レンダリングできない文字に出会ったときのリストを コメントや警告の形で記してもかまいません(may)。

  • E<...> may freely appear in any formatting code (other than in another E<...> or in an Z<>). That is, "X<The E<euro>1,000,000 Solution>" is valid, as is "L<The E<euro>1,000,000 Solution|Million::Euros>".

    E<...> は (他の E<...> および Z<> の中を除く) 任意の フォーマッティングコードの中に自由に現れてもかまいません(may)。 つまり、"X<The E<euro>1,000,000 Solution>" は、 "L<The E<euro>1,000,000 Solution|Million::Euros>" と同様 有効ということです。

  • Some Pod formatters output to formats that implement non-breaking spaces as an individual character (which I'll call "NBSP"), and others output to formats that implement non-breaking spaces just as spaces wrapped in a "don't break this across lines" code. Note that at the level of Pod, both sorts of codes can occur: Pod can contain a NBSP character (whether as a literal, or as a "E<160>" or "E<nbsp>" code); and Pod can contain "S<foo I<bar> baz>" codes, where "mere spaces" (character 32) in such codes are taken to represent non-breaking spaces. Pod parsers should consider supporting the optional parsing of "S<foo I<bar> baz>" as if it were "fooNBSPI<bar>NBSPbaz", and, going the other way, the optional parsing of groups of words joined by NBSP's as if each group were in a S<...> code, so that formatters may use the representation that maps best to what the output format demands.

    Pod フォーマッタによっては、改行なし空白を独立した文字 (ここでは "NBSP" と呼ぶことにします) として実装しているフォーマットへ出力したり、 改行なし空白を「この線の場所で改行しない」コードでラップしている フォーマットに出力したりします。 Pod のレベルでは、どちらのコードもあり得ます: Pod は (リテラル、"E<160>"、"E<nbsp>"という形で) NBSP 文字を 含めることもできます; そして Pod は "S<foo I<bar> baz>" という コードを含むことができます; ここでそのようなコードでの「単なる空白」 (文字 32)は非分割空白を表現します。 Pod パーサは、"S<foo I<bar> baz>" を "fooNBSPI<bar>NBSPbaz" であるかのように、 また NBSP で連結された単語のグループを それぞれのグループが S<...> コードで囲まれているかのようにパースするオプションに 対応することを考慮するべきです(should); これによりフォーマッタは 出力形式が要求する最良のものにマッピングされる表現を使えるかもしれません。

  • Some processors may find that the S<...> code is easiest to implement by replacing each space in the parse tree under the content of the S, with an NBSP. But note: the replacement should apply not to spaces in all text, but only to spaces in printable text. (This distinction may or may not be evident in the particular tree/event model implemented by the Pod parser.) For example, consider this unusual case:

    一部のプロセッサは、S<...> コードを最も簡単に実装するには S の内容のパース木の中にあるそれぞれの空白を NBSP に置き換えることで あることを発見するかもしれません。 しかし注意してください: 変換は 全て のテキストの空白では なく表示される テキストの空白 のみ に適用するべきです(should)。 (この区別は、その Pod パーサによって実装されている特定のツリー/イベント モデルによって明らかかもしれませんしそうではないかもしれません。) 例えば、次のような普通ではない場合を考えます:

       S<L</Autoloaded Functions>>

    This means that the space in the middle of the visible link text must not be broken across lines. In other words, it's the same as this:

    これは、表示されるリンクテキストの途中にある空白は行をまたいではいけない (must not)ということです。 言い換えると、以下と同じです:

       L<"AutoloadedE<160>Functions"/Autoloaded Functions>

    However, a misapplied space-to-NBSP replacement could (wrongly) produce something equivalent to this:

    しかし、空白から NBSP への変換を間違って適用すると、以下のようなものと 等価なものを(間違って)生成してしまうかもしれません:

       L<"AutoloadedE<160>Functions"/AutoloadedE<160>Functions>

    ...which is almost definitely not going to work as a hyperlink (assuming this formatter outputs a format supporting hypertext).

    これはほぼ確実にハイパーリンクとしては動作しません (このフォーマッタが ハイパーテキストに対応した形式に出力すると仮定しています)。

    Formatters may choose to just not support the S format code, especially in cases where the output format simply has no NBSP character/code and no code for "don't break this stuff across lines".

    フォーマッタは、単に S フォーマッティングコードに対応しないことを 選択してもかまいません(may); 特に出力形式に NBSP 文字/コードや 「この内容は行をまたがない」ためのコードがない場合です。

  • Besides the NBSP character discussed above, implementors are reminded of the existence of the other "special" character in Latin-1, the "soft hyphen" character, also known as "discretionary hyphen", i.e. E<173> = E<0xAD> = E<shy>). This character expresses an optional hyphenation point. That is, it normally renders as nothing, but may render as a "-" if a formatter breaks the word at that point. Pod formatters should, as appropriate, do one of the following: 1) render this with a code with the same meaning (e.g., "\-" in RTF), 2) pass it through in the expectation that the formatter understands this character as such, or 3) delete it.

    先に議論した NBSP 文字の他に、実装者は Latin-1 にその他の「特殊」文字の 存在を思い出させます; "soft hyphen" 文字、またの名を "discretionary hyphen"、例えば E<173> = E<0xAD> = E<shy>) です。 この文字はオプションのハイフン位置を表現します。 これは、普通は何もレンダリングしませんが、フォーマッタがこの位置で 単語を分割したとき、"-" としてレンダリングされます。 Pod フォーマッタは、必要に応じて、次のうちどれか一つを 行うべきです(should): 1) これを同じ意味を持つコードとしてレンダリングする (例えば RTF の "\-" in RTF) 2) フォーマッタがこの文字を理解すると仮定して そのまま流す 3) 削除する。

    For example:

    例えば:

      sigE<shy>action
      manuE<shy>script
      JarkE<shy>ko HieE<shy>taE<shy>nieE<shy>mi

    These signal to a formatter that if it is to hyphenate "sigaction" or "manuscript", then it should be done as "sig-[linebreak]action" or "manu-[linebreak]script" (and if it doesn't hyphenate it, then the E<shy> doesn't show up at all). And if it is to hyphenate "Jarkko" and/or "Hietaniemi", it can do so only at the points where there is a E<shy> code.

    これらは、もし "sigaction" や "manuscript" をハイフネーションするときは、 "sig-[linebreak]action" や "manu-[linebreak]script" として 行うべき(should)であることを示します(そしてもし ハイフネーションしないなら、 E<shy> は全く現れません)。 そして "Jarkko" や "Hietaniemi" をハイフネーションするときは、 E<shy> コードがある場所でのみ行えます。

    In practice, it is anticipated that this character will not be used often, but formatters should either support it, or delete it.

    実際には、この文字はそう頻繁に使われないであろうと推測されますが、 フォーマッタはこれに対応するか、削除するかのどちらかをするべきです(should)。

  • If you think that you want to add a new command to Pod (like, say, a "=biblio" command), consider whether you could get the same effect with a for or begin/end sequence: "=for biblio ..." or "=begin biblio" ... "=end biblio". Pod processors that don't understand "=for biblio", etc, will simply ignore it, whereas they may complain loudly if they see "=biblio".

    Pod に (例えば "=biblio" コマンドのような) 新しいコマンドを追加したいと 考えているなら、同じ効果を for や begin/end の並びで得られないかどうかを 考慮してください: "=for biblio ..." または "=begin biblio" ... "=end biblio"。 "=for biblio" などを理解しない Pod プロセッサは単にこれを無視しますが、 "=biblio" を見つけると大声で警告を発生させるかもしれません。

  • Throughout this document, "Pod" has been the preferred spelling for the name of the documentation format. One may also use "POD" or "pod". For the documentation that is (typically) in the Pod format, you may use "pod", or "Pod", or "POD". Understanding these distinctions is useful; but obsessing over how to spell them, usually is not.

    この文書を通じて、"Pod" は文書フォーマットの名前として使われている 綴りです。 "POD" や "pod" を使う人もいるかもしれません。 (典型的には Pod 形式の文書では、"pod", "Pod", "POD" のいずれかを使えます。 これらの違いを理解することは有用です; しかしどう綴るかに捕らわれすぎるのは 普通は有用ではありません。

L<...> コードについて

As you can tell from a glance at perlpod, the L<...> code is the most complex of the Pod formatting codes. The points below will hopefully clarify what it means and how processors should deal with it.

perlpod をちらっと見るだけでわかることは、L<...> コードは Pod フォーマッティングコードの中で最も複雑であると言うことです。 以下に示すポイントは、これが何を意味し、プロセッサがこれを どのように扱うべきかをできれば明確化しようとするものです。

  • In parsing an L<...> code, Pod parsers must distinguish at least four attributes:

    L<...> コードをパースするときに、Pod パーサは少なくとも四つの 属性を区別しなければなりません(must):

    First:

    (第一:)

    The link-text. If there is none, this must be undef. (E.g., in "L<Perl Functions|perlfunc>", the link-text is "Perl Functions". In "L<Time::HiRes>" and even "L<|Time::HiRes>", there is no link text. Note that link text may contain formatting.)

    リンクテキスト。 もしなければ、undef でなければなりません(must)。 (例えば、"L<Perl Functions|perlfunc>" では、リンクテキストは "Perl Functions" です。 "L<Time::HiRes>" や、"L<|Time::HiRes>" でも、リンクテキストは ありません。 リンクテキストにはフォーマッティングコードを含んでいるかもしれないことに 注意してください。)

    Second:

    (第二:)

    The possibly inferred link-text; i.e., if there was no real link text, then this is the text that we'll infer in its place. (E.g., for "L<Getopt::Std>", the inferred link text is "Getopt::Std".)

    リンクテキストと推論されるもの; つまり、もし実際のリンクテキストが なければ、これはリンクテキストと推論されたものです。 (例えば、"L<Getopt::Std>" では、推論されたリンクテキストは "Getopt::Std" です。)

    Third:

    (第三:)

    The name or URL, or undef if none. (E.g., in "L<Perl Functions|perlfunc>", the name (also sometimes called the page) is "perlfunc". In "L</CAVEATS>", the name is undef.)

    名前または URL (なければ undef)。 (例えば、"L<Perl Functions|perlfunc>" では、名前 (また時々ページと 呼ばれるもの) は "perlfunc" です。 "L</CAVEATS>" では、名前は undef です。)

    Fourth:

    (第四:)

    The section (AKA "item" in older perlpods), or undef if none. E.g., in "L<Getopt::Std/DESCRIPTION>", "DESCRIPTION" is the section. (Note that this is not the same as a manpage section like the "5" in "man 5 crontab". "Section Foo" in the Pod sense means the part of the text that's introduced by the heading or item whose text is "Foo".)

    章 (古い perlpod では「アイテム」と呼ばれていたもの)(なければ undef)。 例えば、"L<Getopt::Std/DESCRIPTION>" では、"DESCRIPTION" が章です。 (これは "man 5 crontab" での "5" のような man ページの章と同じでは ないことに注意してください。 Pod での "○○の章" というのはテキストが "○○" である見出しや アイテムによって導入されるテキストの一部を意味します。)

    Pod parsers may also note additional attributes including:

    また、Pod パーサは以下のような追加の属性に留意してもかまいません(may):

    Fifth:

    (第五:)

    A flag for whether item 3 (if present) is a URL (like "http://lists.perl.org" is), in which case there should be no section attribute; a Pod name (like "perldoc" and "Getopt::Std" are); or possibly a man page name (like "crontab(5)" is).

    (もしあれば) 第三のアイテムが ("http://lists.perl.org" のような) URL かどうかを示すフラグ; この場合章の属性; はありません; ("perldoc" や "Getopt::Std" のような) Pod 名 ; ("crontab(5)" のような) man ページ名かもしれないものではありません。

    Sixth:

    (第六:)

    The raw original L<...> content, before text is split on "|", "/", etc, and before E<...> codes are expanded.

    "|", "/" などで分割したり E<...> コードを展開したりする前の生の L<...> の内容。

    (The above were numbered only for concise reference below. It is not a requirement that these be passed as an actual list or array.)

    (上述の番号付けは以下での参照のためだけのものです。 これらが実際のリストや配列として渡されることは必須ではありません。)

    For example:

    例えば:

      L<Foo::Bar>
        =>  undef,                         # link text
            "Foo::Bar",                    # possibly inferred link text
            "Foo::Bar",                    # name
            undef,                         # section
            'pod',                         # what sort of link
            "Foo::Bar"                     # original content
    
      L<Perlport's section on NL's|perlport/Newlines>
        =>  "Perlport's section on NL's",  # link text
            "Perlport's section on NL's",  # possibly inferred link text
            "perlport",                    # name
            "Newlines",                    # section
            'pod',                         # what sort of link
            "Perlport's section on NL's|perlport/Newlines"
                                           # original content
    
      L<perlport/Newlines>
        =>  undef,                         # link text
            '"Newlines" in perlport',      # possibly inferred link text
            "perlport",                    # name
            "Newlines",                    # section
            'pod',                         # what sort of link
            "perlport/Newlines"            # original content
    
      L<crontab(5)/"DESCRIPTION">
        =>  undef,                         # link text
            '"DESCRIPTION" in crontab(5)', # possibly inferred link text
            "crontab(5)",                  # name
            "DESCRIPTION",                 # section
            'man',                         # what sort of link
            'crontab(5)/"DESCRIPTION"'     # original content
    
      L</Object Attributes>
        =>  undef,                         # link text
            '"Object Attributes"',         # possibly inferred link text
            undef,                         # name
            "Object Attributes",           # section
            'pod',                         # what sort of link
            "/Object Attributes"           # original content
    
      L<https://www.perl.org/>
        =>  undef,                         # link text
            "https://www.perl.org/",       # possibly inferred link text
            "https://www.perl.org/",       # name
            undef,                         # section
            'url',                         # what sort of link
            "https://www.perl.org/"         # original content
    
      L<Perl.org|https://www.perl.org/>
        =>  "Perl.org",                    # link text
            "https://www.perl.org/",       # possibly inferred link text
            "https://www.perl.org/",       # name
            undef,                         # section
            'url',                         # what sort of link
            "Perl.org|https://www.perl.org/" # original content

    Note that you can distinguish URL-links from anything else by the fact that they match m/\A\w+:[^:\s]\S*\z/. So L<http://www.perl.com> is a URL, but L<HTTP::Response> isn't.

    URL リンクは m/\A\w+:[^:\s]\S*\z/ でマッチングするという事実でその他の ものと区別できると言うことに注意してください。 従って L<http://www.perl.com> は URL ですが、 L<HTTP::Response> は違います。

  • In case of L<...> codes with no "text|" part in them, older formatters have exhibited great variation in actually displaying the link or cross reference. For example, L<crontab(5)> would render as "the crontab(5) manpage", or "in the crontab(5) manpage" or just "crontab(5)".

    "text|" 部分がない L<...> コードの場合、古いフォーマッタが実際に 表示するリンクやクロスリファレンスには様々なパターンがあります。 例えば、L<crontab(5)> は "the crontab(5) manpage" あるいは "in the crontab(5) manpage" あるいは単に "crontab(5)" と レンダリングされます。

    Pod processors must now treat "text|"-less links as follows:

    Pod プロセッサは "text|" の内リンクを以下のように 扱わなければなりません(must):

      L<name>         =>  L<name|name>
      L</section>     =>  L<"section"|/section>
      L<name/section> =>  L<"section" in name|name/section>
  • Note that section names might contain markup. I.e., if a section starts with:

    セクション名にはマークアップを含んでいるかも知れないことに注意してください。 つまり、セクションが以下のいずれかで始まっていると:

      =head2 About the C<-M> Operator

    or with:

    または:

      =item About the C<-M> Operator

    then a link to it would look like this:

    これへのリンクは以下のようになります:

      L<somedoc/About the C<-M> Operator>

    Formatters may choose to ignore the markup for purposes of resolving the link and use only the renderable characters in the section name, as in:

    フォーマッタはリンクを解決する目的でマークアップを無視して、 以下のようにセクション名としてレンダリング可能な文字だけを使うことを 選択してもかまいません(may):

      <h1><a name="About_the_-M_Operator">About the <code>-M</code>
      Operator</h1>
    
      ...
    
      <a href="somedoc#About_the_-M_Operator">About the <code>-M</code>
      Operator" in somedoc</a>
  • Previous versions of perlpod distinguished L<name/"section"> links from L<name/item> links (and their targets). These have been merged syntactically and semantically in the current specification, and section can refer either to a "=headn Heading Content" command or to a "=item Item Content" command. This specification does not specify what behavior should be in the case of a given document having several things all seeming to produce the same section identifier (e.g., in HTML, several things all producing the same anchorname in <a name="anchorname">...</a> elements). Where Pod processors can control this behavior, they should use the first such anchor. That is, L<Foo/Bar> refers to the first "Bar" section in Foo.

    以前のバージョンの perlpod は L<name/"section"> リンクを L<name/item> リンク (およびそのターゲット) と区別していました。 現在の仕様ではこれらは文法的および意味論的にマージされ、 section は "=headn Heading Content" コマンドまたは "=item Item Content" コマンドのどちらかを参照できるようになりました。 この仕様は、一つの文書に同じ section 識別子を出力するように見えるものが 複数ある場合 (例えば、HTML では、<a name="anchorname">...</a> で 同じ anchorname を生成するものが複数ある場合) の振る舞いは 規定していません。 Pod プロセッサがこの振る舞いを制御できるところでは、そのようなアンカーの 最初のものを使うべきです(should)。 つまり、L<Foo/Bar> は Foo にある 最初の "Bar" を参照します。

    But for some processors/formats this cannot be easily controlled; as with the HTML example, the behavior of multiple ambiguous <a name="anchorname">...</a> is most easily just left up to browsers to decide.

    しかし一部のプロセッサ/形式はこれは簡単には制御できません; HTML の例では、 複数の曖昧な <a name="anchorname">...</a> の振る舞いは、ブラウザが 決定するに任せるのがもっとも簡単です。

  • In a L<text|...> code, text may contain formatting codes for formatting or for E<...> escapes, as in:

    L<text|...> コードは、以下のようにフォーマッティングや E<...> のためのフォーマッティングコードを含んでいてもかまいません(may):

      L<B<ummE<234>stuff>|...>

    For L<...> codes without a "name|" part, only E<...> and Z<> codes may occur. That is, authors should not use "L<B<Foo::Bar>>".

    "name|" 部分のない L<...> コードでは、 E<...>Z<> のコードのみ使ってもかまいません(may)。 つまり、著者は "L<B<Foo::Bar>>" を使うべきではありません (should not)。

    Note, however, that formatting codes and Z<>'s can occur in any and all parts of an L<...> (i.e., in name, section, text, and url).

    しかし、フォーマッティングコードと Z<> は L<...> の全ての部分 (つまり in name, section, text, url) に現れることに 注意してください。

    Authors must not nest L<...> codes. For example, "L<The L<Foo::Bar> man page>" should be treated as an error.

    著者は L<...> コードをネストさせてはいけません(must not)。 例えば、"L<The L<Foo::Bar> man page>" はエラーとして扱われるべきです (should)。

  • Note that Pod authors may use formatting codes inside the "text" part of "L<text|name>" (and so on for L<text|/"sec">).

    Pod 著者は "L<text|name>" (および L<text|/"sec">)の "text" 部分には フォーマッティングコードを使ってもかまわない(may)ことに注意してください。

    In other words, this is valid:

    言い換えると、次のものは有効です:

      Go read L<the docs on C<$.>|perlvar/"$.">

    Some output formats that do allow rendering "L<...>" codes as hypertext, might not allow the link-text to be formatted; in that case, formatters will have to just ignore that formatting.

    "L<...>" コードをハイパーテキストとしてレンダリングする一部の出力形式は フォーマットされたリンクテキストを許さないかもしれません; この場合、フォーマッタは単にフォーマッティングを無視する必要があります。

  • At time of writing, L<name> values are of two types: either the name of a Pod page like L<Foo::Bar> (which might be a real Perl module or program in an @INC / PATH directory, or a .pod file in those places); or the name of a Unix man page, like L<crontab(5)>. In theory, L<chmod> is ambiguous between a Pod page called "chmod", or the Unix man page "chmod" (in whatever man-section). However, the presence of a string in parens, as in "crontab(5)", is sufficient to signal that what is being discussed is not a Pod page, and so is presumably a Unix man page. The distinction is of no importance to many Pod processors, but some processors that render to hypertext formats may need to distinguish them in order to know how to render a given L<foo> code.

    これを書いている時点で、L<name> の値は二つの種類があります: L<Foo::Bar> のような Pod ページの名前 (@INC / PATH ディレクトリにある実際の Perl モジュールやプログラムかもしれませんし、 それらの場所にある .pod ファイルかもしれません); または L<crontab(5)> のような Unix man ページの名前です。 理論的には、L<chmod> は "chmod" という名前の Pod ページか "chmod" (man セクションのどこかにある) Unix man ページかがあいまいです。 しかし、"crontab(5)" のように、かっこの中に文字があるなら、対象となっている ものが Pod ページでないことを示すには十分なので、これはおそらく Unix man ページです。 区別は多くの Pod プロセッサにとっては重要ではありませんが、 ハイパーテキスト形式にレンダリングするプロセッサは、指定された L<foo> コードをどのようにレンダリングするかを知るために これらを区別する必要があるかもしれません。

  • Previous versions of perlpod allowed for a L<section> syntax (as in L<Object Attributes>), which was not easily distinguishable from L<name> syntax and for L<"section"> which was only slightly less ambiguous. This syntax is no longer in the specification, and has been replaced by the L</section> syntax (where the slash was formerly optional). Pod parsers should tolerate the L<"section"> syntax, for a while at least. The suggested heuristic for distinguishing L<section> from L<name> is that if it contains any whitespace, it's a section. Pod processors should warn about this being deprecated syntax.

    以前のバージョンの perlpod では(L<Object Attributes> のような) L<section> 文法を許していました; これは L<name> 文法と簡単には区別できず、 L<"section"> とはほんの少しだけしか曖昧性が少なくなりません。 この文法は現在の仕様には含まれず、L</section> 文法で 置き換えられました(以前はスラッシュはオプションでした)。 Pod パーサは、少なくともしばらくの間は、L<"section"> 文法を 許容するべきです(should)。 L<name>L<section> と区別するための推奨される ヒューリスティックは、もし空白が含まれていれば、それは section と いうことです。 Pod プロセッサはこれらの廃止予定の文法に関して警告するべきです(should)。

=over...=back 領域について

"=over"..."=back" regions are used for various kinds of list-like structures. (I use the term "region" here simply as a collective term for everything from the "=over" to the matching "=back".)

"=over"..."=back" 領域は、様々な種類のリスト風の構造に使われます。 (ここでは、「領域」という用語は単に "=over" からそれに対応する "=back" までの全てを含むものという意味使っています。)

  • The non-zero numeric indentlevel in "=over indentlevel" ... "=back" is used for giving the formatter a clue as to how many "spaces" (ems, or roughly equivalent units) it should tab over, although many formatters will have to convert this to an absolute measurement that may not exactly match with the size of spaces (or M's) in the document's base font. Other formatters may have to completely ignore the number. The lack of any explicit indentlevel parameter is equivalent to an indentlevel value of 4. Pod processors may complain if indentlevel is present but is not a positive number matching m/\A(\d*\.)?\d+\z/.

    "=over indentlevel" ... "=back" での非ゼロ数値 indentlevel は、 フォーマッタに、いくつの「空白」(ems またはおよそ等価な単位) を 空けるべきかに関する手がかりを与えますが、多くのフォーマッタはこれを、 文書の基本フォントの空白 (あるいは M) のサイズと正確に一致しない 全体的な長さに変換する必要があります。 その他のフォーマッタは数値を完全に無視する必要があるかもしれません。 明示的な indentlevel パラメータがない場合、indentlevel の値が 4 の場合と等価です。 Pod プロセッサは、indentlevel が存在するけれども m/\A(\d*\.)?\d+\z/ にマッチングする正数ではない場合に警告を 出してもかまいません(may)。

  • Authors of Pod formatters are reminded that "=over" ... "=back" may map to several different constructs in your output format. For example, in converting Pod to (X)HTML, it can map to any of <ul>...</ul>, <ol>...</ol>, <dl>...</dl>, or <blockquote>...</blockquote>. Similarly, "=item" can map to <li> or <dt>.

    Pod フォーマッタの作者は、"=over" ... "=back" は出力フォーマットによっては 複数の異なった構造に割り当てられるかもしれない(may)ことに留意してください。 例えば、Pod を (X)HTML に変換する場合、<ul>...</ul>, <ol>...</ol>, <dl>...</dl>, <blockquote>...</blockquote> のいずれかに 割り当てられるかもしれません。 同様に、"=item" は <li> または <dt> に割り当てられるかもしれません。

  • Each "=over" ... "=back" region should be one of the following:

    それぞれの "=over" ... "=back" 領域は以下のうちの一つであるべきです(should):

    • An "=over" ... "=back" region containing only "=item *" commands, each followed by some number of ordinary/verbatim paragraphs, other nested "=over" ... "=back" regions, "=for..." paragraphs, and "=begin"..."=end" regions.

      "=item *" 段落および、 通常の段落、そのままの段落、ネストした "=over" ... "=back" 領域、"=for..." 段落、"=begin"..."=end" コード のいずれかが任意の数引き続いたもののみからなる "=over" ... "=back" 領域。

      (Pod processors must tolerate a bare "=item" as if it were "=item *".) Whether "*" is rendered as a literal asterisk, an "o", or as some kind of real bullet character, is left up to the Pod formatter, and may depend on the level of nesting.

      (Pod プロセッサは、生の "=item" を、"=item *" であるかのように 扱わなければなりません(must)。) "*" をそのままアスタリスクとして表示するか、"o" を使うか、あるいは ある種の実際の黒丸を使うかは Pod フォーマッタに任されていて、 これはネストレベルに依存するかも知れません。

    • An "=over" ... "=back" region containing only m/\A=item\s+\d+\.?\s*\z/ paragraphs, each one (or each group of them) followed by some number of ordinary/verbatim paragraphs, other nested "=over" ... "=back" regions, "=for..." paragraphs, and/or "=begin"..."=end" codes. Note that the numbers must start at 1 in each section, and must proceed in order and without skipping numbers.

      m/\A=item\s+\d+\.?\s*\z/ 段落および、 通常の段落、そのままの段落、ネストした "=over" ... "=back" 領域、"=for..." 段落、"=begin"..."=end" コード のいずれかが任意の数引き続いたもののみからなる "=over" ... "=back" 領域。 各章の番号は 1 から始まり、省略されることなく続かなければならないことに 注意してください。

      (Pod processors must tolerate lines like "=item 1" as if they were "=item 1.", with the period.)

      (Pod プロセッサは、"=item 1" のような行を、ピリオド付きの "=item 1." であるかのように扱わなければなりません(must)。)

    • An "=over" ... "=back" region containing only "=item [text]" commands, each one (or each group of them) followed by some number of ordinary/verbatim paragraphs, other nested "=over" ... "=back" regions, or "=for..." paragraphs, and "=begin"..."=end" regions.

      "=item [text]" 段落および、 通常の段落、そのままの段落、ネストした "=over" ... "=back" 領域、"=for..." 段落、"=begin"..."=end" コード のいずれかが任意の数引き続いたもののみからなる "=over" ... "=back" 領域。

      The "=item [text]" paragraph should not match m/\A=item\s+\d+\.?\s*\z/ or m/\A=item\s+\*\s*\z/, nor should it match just m/\A=item\s*\z/.

      "=item [text]" 段落は、m/\A=item\s+\d+\.?\s*\z/, m/\A=item\s+\*\s*\z/ にマッチングしたり、単に m/\A=item\s*\z/ にマッチングしたりするべきではありません(should not)。

    • An "=over" ... "=back" region containing no "=item" paragraphs at all, and containing only some number of ordinary/verbatim paragraphs, and possibly also some nested "=over" ... "=back" regions, "=for..." paragraphs, and "=begin"..."=end" regions. Such an itemless "=over" ... "=back" region in Pod is equivalent in meaning to a "<blockquote>...</blockquote>" element in HTML.

      "=item" 段落がまったくなく、いくつかの普通/そのままの段落と、 おそらくはいくつかのネストした "=over" ... "=back" 領域、"=for..." 段落、 "=begin"..."=end" 領域のみがある "=over" ... "=back" 領域。 Pod にあるこのような item なしの "=over" ... "=back" 領域は、HTML での "<blockquote>...</blockquote>" 要素と等価な意味を持ちます。

    Note that with all the above cases, you can determine which type of "=over" ... "=back" you have, by examining the first (non-"=cut", non-"=pod") Pod paragraph after the "=over" command.

    上述の全ての場合において、"=over" コマンドの後の ("=cut" と "=pod" を 除く) 最初の Pod 段落を調べることで、どの形式の "=over" ... "=back" であるかを決定できることに注意してください。

  • Pod formatters must tolerate arbitrarily large amounts of text in the "=item text..." paragraph. In practice, most such paragraphs are short, as in:

    Pod フォーマッタは "=item text..." に任意の長さのテキストを 許容 しなければなりません (must)。 実際には、このような段落のほとんどは以下のような短いものです:

      =item For cutting off our trade with all parts of the world

    But they may be arbitrarily long:

    しかし任意に長くなるかも知れません:

      =item For transporting us beyond seas to be tried for pretended
      offenses
    
      =item He is at this time transporting large armies of foreign
      mercenaries to complete the works of death, desolation and
      tyranny, already begun with circumstances of cruelty and perfidy
      scarcely paralleled in the most barbarous ages, and totally
      unworthy the head of a civilized nation.
  • Pod processors should tolerate "=item *" / "=item number" commands with no accompanying paragraph. The middle item is an example:

    Pod プロセッサは、対応する段落のない "=item *" / "=item number" コマンドを許容するべきです(should)。 中間の item が例です:

      =over
    
      =item 1
    
      Pick up dry cleaning.
    
      =item 2
    
      =item 3
    
      Stop by the store.  Get Abba Zabas, Stoli, and cheap lawn chairs.
    
      =back
  • No "=over" ... "=back" region can contain headings. Processors may treat such a heading as an error.

    "=over" ... "=back" 領域に見出しを含めることはできません。 プロセッサはそのような見出しをエラーとして扱ってもかまいません(may)。

  • Note that an "=over" ... "=back" region should have some content. That is, authors should not have an empty region like this:

    "=over" ... "=back" 領域には内容があるべきであることに注意してください。 つまり、作者は以下のような空の領域を作るべきではありません:

      =over
    
      =back

    Pod processors seeing such a contentless "=over" ... "=back" region, may ignore it, or may report it as an error.

    Pod プロセッサがこのような、内容のない "=over" ... "=back" 領域を 発見した場合、無視してもかまいません(may)し、エラーとして 報告してもかまいません(may)。

  • Processors must tolerate an "=over" list that goes off the end of the document (i.e., which has no matching "=back"), but they may warn about such a list.

    プロセッサは、文書の末尾まで続く(つまり対応する "=back" がない) "=over" リストを許容しなければなりません(must)が、そのようなリストに 警告を出してもかまいません(may)。

  • Authors of Pod formatters should note that this construct:

    Pod フォーマッタの作者はこのような構造に注意するべきです:

      =item Neque
    
      =item Porro
    
      =item Quisquam Est
    
      Qui dolorem ipsum quia dolor sit amet, consectetur, adipisci 
      velit, sed quia non numquam eius modi tempora incidunt ut
      labore et dolore magnam aliquam quaerat voluptatem.
    
      =item Ut Enim

    is semantically ambiguous, in a way that makes formatting decisions a bit difficult. On the one hand, it could be mention of an item "Neque", mention of another item "Porro", and mention of another item "Quisquam Est", with just the last one requiring the explanatory paragraph "Qui dolorem ipsum quia dolor..."; and then an item "Ut Enim". In that case, you'd want to format it like so:

    というのは意味論としてはあいまいで、フォーマッティング方法の決定は 少し難しいです。 まず、これはアイテム "Neque" への言及、次のアイテム "Porro" への 言及、次のアイテム "Quisquam Est" への言及で、単に最後のものだけ 説明の段落 "Qui dolorem ipsum quia dolor..." があって、それから アイテム "Ut Enim" があります。 この場合、以下のようにフォーマットしてほしいでしょう:

      Neque
    
      Porro
    
      Quisquam Est
        Qui dolorem ipsum quia dolor sit amet, consectetur, adipisci
        velit, sed quia non numquam eius modi tempora incidunt ut
        labore et dolore magnam aliquam quaerat voluptatem.
    
      Ut Enim

    But it could equally well be a discussion of three (related or equivalent) items, "Neque", "Porro", and "Quisquam Est", followed by a paragraph explaining them all, and then a new item "Ut Enim". In that case, you'd probably want to format it like so:

    しかし、同様に、三つの(関係のある、あるいは等価な)アイテムである "Neque", "Porro", "Quisquam Est" があり、引き続いてこれら全てを 説明する段落があり、それから新しいアイテム "Ut Enim" がある、とも取れます。 この場合、おそらく以下のようにフォーマットしてほしいでしょう:

      Neque
      Porro
      Quisquam Est
        Qui dolorem ipsum quia dolor sit amet, consectetur, adipisci
        velit, sed quia non numquam eius modi tempora incidunt ut
        labore et dolore magnam aliquam quaerat voluptatem.
    
      Ut Enim

    But (for the foreseeable future), Pod does not provide any way for Pod authors to distinguish which grouping is meant by the above "=item"-cluster structure. So formatters should format it like so:

    しかし(予測可能な未来において)、Pod は Pod 作者に上述の "=item" の 塊の構造を意味するようなグルーピングを区別する方法を提供しません。 従ってフォーマッタは以下のようにフォーマットするべきです(should):

      Neque
    
      Porro
    
      Quisquam Est
    
        Qui dolorem ipsum quia dolor sit amet, consectetur, adipisci
        velit, sed quia non numquam eius modi tempora incidunt ut
        labore et dolore magnam aliquam quaerat voluptatem.
    
      Ut Enim

    That is, there should be (at least roughly) equal spacing between items as between paragraphs (although that spacing may well be less than the full height of a line of text). This leaves it to the reader to use (con)textual cues to figure out whether the "Qui dolorem ipsum..." paragraph applies to the "Quisquam Est" item or to all three items "Neque", "Porro", and "Quisquam Est". While not an ideal situation, this is preferable to providing formatting cues that may be actually contrary to the author's intent.

    つまり、(少なくともおおよそは)アイテム間の空白は段落間の空白と 同じであるべきです(should)(しかしこの空白はテキストの行の高さより 少なくてもかまいません(may))。 これにより、"Qui dolorem ipsum..." 段落が "Quisquam Est" アイテムのみと "Neque", "Porro", "Quisquam Est" の三つのアイテム全てのどちらに 掛かるのかを判断する文脈上の手がかりを使えるように読者に残しておきます。 理想的な状況ではありませんが、実際には著者の意図に反した フォーマッティングの手がかりを提供するよりは好ましいです。

データ段落と "=begin/=end" 領域について

Data paragraphs are typically used for inlining non-Pod data that is to be used (typically passed through) when rendering the document to a specific format:

データ段落は典型的には文書を特定のフォーマットでレンダリングするときに 使われる(典型的にはそのまま渡される)非 Pod データを含ませるために 使います:

  =begin rtf

  \par{\pard\qr\sa4500{\i Printed\~\chdate\~\chtime}\par}

  =end rtf

The exact same effect could, incidentally, be achieved with a single "=for" paragraph:

正確に同じ効果は、偶然ながら、単一の "=for" 段落でも達成できます:

  =for rtf \par{\pard\qr\sa4500{\i Printed\~\chdate\~\chtime}\par}

(Although that is not formally a data paragraph, it has the same meaning as one, and Pod parsers may parse it as one.)

(これは形式的にはデータ段落ではありませんが、同じ意味を持ち、 Pod パーサは同じようにパースするでしょう。)

Another example of a data paragraph:

データ段落のもう一つの例です:

  =begin html

  I like <em>PIE</em>!

  <hr>Especially pecan pie!

  =end html

If these were ordinary paragraphs, the Pod parser would try to expand the "E</em>" (in the first paragraph) as a formatting code, just like "E<lt>" or "E<eacute>". But since this is in a "=begin identifier"..."=end identifier" region and the identifier "html" doesn't begin have a ":" prefix, the contents of this region are stored as data paragraphs, instead of being processed as ordinary paragraphs (or if they began with a spaces and/or tabs, as verbatim paragraphs).

通常の段落の場合、Pod パーサは (最初の段落にある) "E</em>" を "E<lt>" や "E<eacute>" と同じように、 フォーマッティングコードとして展開しようとします。 しかし、これは "=begin identifier"..."=end identifier" 領域の 中にあり、かつ 識別子 "html" は ":" 接頭辞で始まっていないので、 この領域の内容は、通常の段落(あるいは、もしスペースやタブで 始まっている場合はそのままの段落)としてされるのではなく、データ段落として 保管されます。

As a further example: At time of writing, no "biblio" identifier is supported, but suppose some processor were written to recognize it as a way of (say) denoting a bibliographic reference (necessarily containing formatting codes in ordinary paragraphs). The fact that "biblio" paragraphs were meant for ordinary processing would be indicated by prefacing each "biblio" identifier with a colon:

さらなる例: これを書いている時点で、"biblio" 識別子には対応していませんが、 一部のプロセッサがこれを(例えば、必然的に通常の段落に フォーマッティングコードを含んでいる)参考文献を示すものとして認識する ように書かれているとします。 "biblio" 段落が通常通り処理されるということは、"biblio" 識別子にコロンが 付いていることで示されています:

  =begin :biblio

  Wirth, Niklaus.  1976.  I<Algorithms + Data Structures =
  Programs.>  Prentice-Hall, Englewood Cliffs, NJ.

  =end :biblio

This would signal to the parser that paragraphs in this begin...end region are subject to normal handling as ordinary/verbatim paragraphs (while still tagged as meant only for processors that understand the "biblio" identifier). The same effect could be had with:

これはパーサに、この begin...end 領域は普通の/そのままの段落として 通常通り扱われることを前提としていることを示します (一方 "biblio" 識別子を理解するプロセッサのみのためのものであるという 意味も持ちます)。 同じ効果は以下のようにしても得られます:

  =for :biblio
  Wirth, Niklaus.  1976.  I<Algorithms + Data Structures =
  Programs.>  Prentice-Hall, Englewood Cliffs, NJ.

The ":" on these identifiers means simply "process this stuff normally, even though the result will be for some special target". I suggest that parser APIs report "biblio" as the target identifier, but also report that it had a ":" prefix. (And similarly, with the above "html", report "html" as the target identifier, and note the lack of a ":" prefix.)

これらの識別子の ":" は単に「結果が特別なターゲットのためのものであっても、 この内容を通常通り処理する」ことを意味します。 私はパーサ API が "biblio" をターゲット識別子として報告するだけでなく、 ":" 接頭辞があることも報告することを推奨します。 (そして同じように、上述の "html" では、"html" をターゲット識別子として、 また ":" 接頭辞が ない ことを報告します。)

Note that a "=begin identifier"..."=end identifier" region where identifier begins with a colon, can contain commands. For example:

identifier がコロンで始まっている "=begin identifier"..."=end identifier" 領域は、コマンドを含むことが できる ことに注意してください。 例えば:

  =begin :biblio

  Wirth's classic is available in several editions, including:

  =for comment
   hm, check abebooks.com for how much used copies cost.

  =over

  =item

  Wirth, Niklaus.  1975.  I<Algorithmen und Datenstrukturen.>
  Teubner, Stuttgart.  [Yes, it's in German.]

  =item

  Wirth, Niklaus.  1976.  I<Algorithms + Data Structures =
  Programs.>  Prentice-Hall, Englewood Cliffs, NJ.

  =back

  =end :biblio

Note, however, a "=begin identifier"..."=end identifier" region where identifier does not begin with a colon, should not directly contain "=head1" ... "=head4" commands, nor "=over", nor "=back", nor "=item". For example, this may be considered invalid:

しかし、"=begin identifier"..."=end identifier" 領域で identifier が コロンで始まって いない 場合、直接 "=head1" ... "=head4" コマンドや "=over", "=back","=item" を直接含むべきではありません(should not)。 例えば、以下のものは不正となります:

  =begin somedata

  This is a data paragraph.

  =head1 Don't do this!

  This is a data paragraph too.

  =end somedata

A Pod processor may signal that the above (specifically the "=head1" paragraph) is an error. Note, however, that the following should not be treated as an error:

Pod プロセッサは上述のようなもの (特に "=head1" 段落) をエラーとして 扱ってもかまいません(may)。 しかし、以下のようなものをエラーとして扱う べきではない (should not) ことに注意してください。

  =begin somedata

  This is a data paragraph.

  =cut

  # Yup, this isn't Pod anymore.
  sub excl { (rand() > .5) ? "hoo!" : "hah!" }

  =pod

  This is a data paragraph too.

  =end somedata

And this too is valid:

そしてこれも正当です:

  =begin someformat

  This is a data paragraph.

    And this is a data paragraph.

  =begin someotherformat

  This is a data paragraph too.

    And this is a data paragraph too.

  =begin :yetanotherformat

  =head2 This is a command paragraph!

  This is an ordinary paragraph!

    And this is a verbatim paragraph!

  =end :yetanotherformat

  =end someotherformat

  Another data paragraph!

  =end someformat

The contents of the above "=begin :yetanotherformat" ... "=end :yetanotherformat" region aren't data paragraphs, because the immediately containing region's identifier (":yetanotherformat") begins with a colon. In practice, most regions that contain data paragraphs will contain only data paragraphs; however, the above nesting is syntactically valid as Pod, even if it is rare. However, the handlers for some formats, like "html", will accept only data paragraphs, not nested regions; and they may complain if they see (targeted for them) nested regions, or commands, other than "=end", "=pod", and "=cut".

上述の "=begin :yetanotherformat" ... "=end :yetanotherformat" 領域の 内容はデータ段落 ではありません; なぜなら 領域の識別子 (":yetanotherformat") がコロンで始まっているからです。 実際のところ、データ段落を含んでいる領域のほとんどはデータ段落 のみ を含んでいます; しかし、上述のようなネスティングは(稀で あるとしても)文法的にはPod として正当です。 しかし、"html" のような一部の形式のハンドラは、データ段落のみをつけつけ、 ネストした領域を受け付けません; また、ネストした領域や、 "=end", "=pod", and "=cut" 以外のコマンドを(ターゲットとしている中に) 発見すると、エラーとなるかもしれません。

Also consider this valid structure:

また、以下の正当な構造を考えてみます:

  =begin :biblio

  Wirth's classic is available in several editions, including:

  =over

  =item

  Wirth, Niklaus.  1975.  I<Algorithmen und Datenstrukturen.>
  Teubner, Stuttgart.  [Yes, it's in German.]

  =item

  Wirth, Niklaus.  1976.  I<Algorithms + Data Structures =
  Programs.>  Prentice-Hall, Englewood Cliffs, NJ.

  =back

  Buy buy buy!

  =begin html

  <img src='wirth_spokesmodeling_book.png'>

  <hr>

  =end html

  Now now now!

  =end :biblio

There, the "=begin html"..."=end html" region is nested inside the larger "=begin :biblio"..."=end :biblio" region. Note that the content of the "=begin html"..."=end html" region is data paragraph(s), because the immediately containing region's identifier ("html") doesn't begin with a colon.

ここで、"=begin html"..."=end html" 領域は、より大きい "=begin :biblio"..."=end :biblio" 領域の内側にネストしています。 "=begin html"..."=end html" 領域の内容はデータ段落です; なぜなら 直接含んでいる領域の識別子 ("html") はコロンで始まって いない からです。

Pod parsers, when processing a series of data paragraphs one after another (within a single region), should consider them to be one large data paragraph that happens to contain blank lines. So the content of the above "=begin html"..."=end html" may be stored as two data paragraphs (one consisting of "<img src='wirth_spokesmodeling_book.png'>\n" and another consisting of "<hr>\n"), but should be stored as a single data paragraph (consisting of "<img src='wirth_spokesmodeling_book.png'>\n\n<hr>\n").

Pod パーサは、(一つの領域に含まれた)連続したデータ段落を処理するときには、 たまたま空行を含んでいる一つの大きなデータ段落として考えるべきです(should)。 それで上述の "=begin html"..."=end html" の内容は二つのデータ段落 (一つは "<img src='wirth_spokesmodeling_book.png'>\n" で、もう一つは "<hr>\n") として保管しても かまいません が(may)、一つの大きな データ段落 ("<img src='wirth_spokesmodeling_book.png'>\n\n<hr>\n") として 保管される べき です(should)。

Pod processors should tolerate empty "=begin something"..."=end something" regions, empty "=begin :something"..."=end :something" regions, and contentless "=for something" and "=for :something" paragraphs. I.e., these should be tolerated:

Pod プロセッサは 空の "=begin something"..."=end something" 領域、 空の "=begin :something"..."=end :something" 領域、中身のない "=for something" 段落と "=for :something" 段落を 許容するべきです(should)。 つまり、いかのようなものは許容されるべきです(should):

  =for html

  =begin html

  =end html

  =begin :biblio

  =end :biblio

Incidentally, note that there's no easy way to express a data paragraph starting with something that looks like a command. Consider:

ところで、コマンドのように見えるもので始まるデータ段落を記述する簡単な 方法はないことに注意してください。 以下のものを考えます:

  =begin stuff

  =shazbot

  =end stuff

There, "=shazbot" will be parsed as a Pod command "shazbot", not as a data paragraph "=shazbot\n". However, you can express a data paragraph consisting of "=shazbot\n" using this code:

ここで、"=shazbot" はデータ段落 "=shazbot\n" ではなく Pod コマンド "shazbot" としてパースされます。 しかし、"=shazbot\n" からなるデータ段落は以下のようにして記述できます:

  =for stuff =shazbot

The situation where this is necessary, is presumably quite rare.

これが必要な状況は、おそらくかなり稀です。

Note that =end commands must match the currently open =begin command. That is, they must properly nest. For example, this is valid:

なお、=end コマンドは現在開いている =begin コマンドと 一致しなければならないことに注意してください。 これは、適切にネストしなければならないということです。 例えば、以下は正当です:

  =begin outer

  X

  =begin inner

  Y

  =end inner

  Z

  =end outer

while this is invalid:

一方、以下は不正です:

  =begin outer

  X

  =begin inner

  Y

  =end outer

  Z

  =end inner

This latter is improper because when the "=end outer" command is seen, the currently open region has the formatname "inner", not "outer". (It just happens that "outer" is the format name of a higher-up region.) This is an error. Processors must by default report this as an error, and may halt processing the document containing that error. A corollary of this is that regions cannot "overlap". That is, the latter block above does not represent a region called "outer" which contains X and Y, overlapping a region called "inner" which contains Y and Z. But because it is invalid (as all apparently overlapping regions would be), it doesn't represent that, or anything at all.

"=end outer" コマンドが現れたとき、現在開いている領域のフォーマット名は "outer" ではなく "inner" なので、これは不適切です。 ("outer" はより高いレベルの領域のフォーマット名です。) これはエラーです。 プロセッサはデフォルトではこれをエラーと報告しなければならず(must)、 エラーを含む文書の処理を停止してもかまいません(may)。 ここから導かれる結論は、領域は「重複」できないということです。 つまり、上述の後者のブロックは X と Y を含む "outer" と呼ばれる領域と、 Y と Z を含む "inner" と呼ばれる重複した領域を表現しているわけではないと いうことです。 しかし、これは (明らかに重複している領域全てのように) 不正なので、 これは表現されなかったり、あるいはまったく表示されなかったりします。

Similarly, this is invalid:

同様に、以下のものも不正です:

  =begin thing

  =end hting

This is an error because the region is opened by "thing", and the "=end" tries to close "hting" [sic].

これは、領域が "thing" で開かれていて "=end" が "hting" (原文のまま) を 閉じようとしているので、エラーです。

This is also invalid:

また、以下のものも不正です:

  =begin thing

  =end

This is invalid because every "=end" command must have a formatname parameter.

これは、全ての "=end" コマンドにはフォーマット名引数が必要なので、 不正です。

SEE ALSO

perlpod, "PODs: Embedded Documentation" in perlsyn, podchecker

作者

Sean M. Burke