<?xml version='1.0' encoding='utf-8'?>
<pod xmlns="http://axkit.org/ns/2000/pod2xml">
<head>
	<title>perlpod - plain old documentation</title>
</head>
<sect1>
<title>DESCRIPTION</title>
<para>
podから何かへのトランスレータはpodファイルを段落毎に読み
込み、それを適切な出力フォーマットへと変換します。段落には
<link xref='#Verbatim_Paragraph'>verbatim</link>,
<link xref='#Command_Paragraph'>command</link>,
<link xref='#Ordinary_Block_of_Text'>ordinary text</link>
の三種類があります。
</para>
<sect2>
<title>Verbatim Paragraph</title>
<para>
そのままの段落。これはインデント(つまり、空白かタブで
始まっているということ)によって認識されます。タブは8カラムごとと
仮定されてそのまま出力されます。特殊なフォーマットエスケープは
ありませんから、イタリックにするといったことはできません。\は\で、
その他の意味はありません。
</para>
</sect2>
<sect2>
<title>Command Paragraph</title>
<para>
すべてのコマンド段落は“=”で始まってその後に識別子が続き、
さらにコマンドをが必要とするテキストが続きます。
現在使えるコマンドは以下の通りです。
</para>
<verbatim><![CDATA[
=head1 heading
=head2 heading
=item text
=over N
=back
=cut
=pod
=for X
=begin X
=end X
]]></verbatim>
<list>
<item><itemtext>=pod</itemtext>
</item>
<item><itemtext>=cut</itemtext>
<para>
“=pod”ディレクティブは、次の“=cunt”までコードの解析を中断し、
なにもしないことをコンパイラーに指示します。これはコードとpodを
混ぜたい場合にドキュメントに別の段落を付加えるのに便利です。
</para>
</item>
<item><itemtext>=head1</itemtext>
</item>
<item><itemtext>=head2</itemtext>
<para>
head1とhead2はそれぞれ第一レベル、第二レベルのヘッダーを、
そのディレクティブと同じ段落にあるテキストを使って生成します。
</para>
</item>
<item><itemtext>=over</itemtext>
</item>
<item><itemtext>=back</itemtext>
</item>
<item><itemtext>=item</itemtext>
<para>
Item, over, and back require a little more explanation: &quot;=over&quot; starts a
section specifically for the generation of a list using &quot;=item&quot; commands. At
the end of your list, use &quot;=back&quot; to end it. You will probably want to give
&quot;4&quot; as the number to &quot;=over&quot;, as some formatters will use this for indentation.
The unit of indentation is optional. If the unit is not given the natural
indentation of the formatting system applied will be used. Note also that
there are some basic rules to using =item: don't use them outside of 
an =over/=back block, use at least one inside an =over/=back block, you don't
_have_ to include the =back if the list just runs off the document, and
perhaps most importantly, keep the items consistent: either use &quot;=item *&quot; for
all of them, to produce bullets, or use &quot;=item 1.&quot;, &quot;=item 2.&quot;, etc., to
produce numbered lists, or use &quot;=item foo&quot;, &quot;=item bar&quot;, etc., i.e., things
that looks nothing like bullets or numbers. If you start with bullets or
numbers, stick with them, as many formatters use the first &quot;=item&quot; type to
decide how to format the list.
</para>
<para>
item, over, backにはもうちょっと説明が必要です。“=over”は“=item”
コマンドを使ってリストを生成するためのセクションを開始します。
リストの末尾では、セクションを終わらせるために“=back”コマンドを
使います。一部のフォーマッターがインデントに使用している“4”を
“=over”に対する数として与えたくなるでしょう。
インデントの数はオプションです。
数が指定されなかった場合、
フォーマットシステムが適用する自然なインデントが用いられます。
=itemを使うに当たり幾つかの基本的なルールが
あることに注意してください。=over/=backブロックの外側で使っては
いけません。=over/=backブロックの中に最低一つ=itemがあること。
リストが単にドキュメントをrun offするだけなら=backを含める必要はありません。
そして、これが多分最も重要なことですが、アイテムに一貫性を持たせることです。
“=item *”をつかってbulletsを使うか、
“=item 1.”、“=item 2.”…として数字を使うか、
あるいは“=item foo”、“=item bar”のようにどちらでもないものを
使うにしろ、
すべてのアイテムに対して同種のものを使ってください。
bullet なり数字を最初に使ったら、多くのフォーマッターが最初の“=item”
タイプをリスト全体に使うようにそれを使いつづけてください。
</para>
</item>
<item><itemtext>=for</itemtext>
</item>
<item><itemtext>=begin</itemtext>
</item>
<item><itemtext>=end</itemtext>
<para>
for, begin, endはpodテキストとして解釈されることのないセクションを
取り込みます。しかし、これは特定のフォーマッターに直接渡されます。
フォーマッターはそのようなフォーマットのセクションを利用することができます。
あるいは完全に無視することもあるでしょう。“=for”
ディレクティブは、それに続く段落全体を“=for”の直後にある
単語によって指定されるフォーマットであることを指定します。例を挙げましょう。
</para>
<verbatim><![CDATA[
=for html <br>
 <p> This is a raw HTML paragraph </p>
]]></verbatim>
<para>
組となっているコマンド“=begin”と“=end”は“=for”と非常に良く
似ています。しかし、一つの段落に対してのみ適用されるのではなく、
“=begin”と“=end”の間にある段落を、特定のフォーマットで
あるように取り扱います。
</para>
<para>
これを使った例を幾つか挙げましょう。
</para>
<verbatim><![CDATA[
=begin html
]]></verbatim>
<verbatim><![CDATA[
<br>Figure 1.<IMG SRC="figure1.png"><br>
]]></verbatim>
<verbatim><![CDATA[
=end html
]]></verbatim>
<verbatim><![CDATA[
=begin text
]]></verbatim>
<verbatim><![CDATA[
---------------
|  foo        |
|        bar  |
---------------
]]></verbatim>
<verbatim><![CDATA[
^^^^ Figure 1. ^^^^
]]></verbatim>
<verbatim><![CDATA[
=end text
]]></verbatim>
<para>
現在使うことのできるフォーマッターの名前は&quot;roff&quot;, &quot;man&quot;, &quot;latex&quot;, 
&quot;tex&quot;, &quot;text&quot;, &quot;html&quot;です(一部のフォーマッターは他のものの別名と
して扱われます)。
</para>
<para>
そして忘れないで欲しいことは、これらのコマンドを使った場合、その
コマンドが影響するのはコマンドが置かれた行ではなく、
コマンドがある<strong>段落</strong>の終端までだということです。ですから先の例には、
各コマンドの後ろに段落を終了させるために空行があるのです。
</para>
<para>
幾つか例を挙げましょう:
</para>
<verbatim><![CDATA[
=over 4
]]></verbatim>
<verbatim><![CDATA[
=item *
]]></verbatim>
<verbatim><![CDATA[
最初のアイテム
]]></verbatim>
<verbatim><![CDATA[
=item *
]]></verbatim>
<verbatim><![CDATA[
二番目のアイテム
]]></verbatim>
<verbatim><![CDATA[
=back
]]></verbatim>
<verbatim><![CDATA[
=over 4
]]></verbatim>
<verbatim><![CDATA[
=item Foo()
]]></verbatim>
<verbatim><![CDATA[
関数 Fooの説明
]]></verbatim>
<verbatim><![CDATA[
=item Bar()
]]></verbatim>
<verbatim><![CDATA[
関数 Barの説明
]]></verbatim>
<verbatim><![CDATA[
=back
]]></verbatim>
</item>
</list>
</sect2>
<sect2>
<title>Ordinary Block of Text</title>
<para>
(通常のテキストブロック)
</para>
<para>
It will be filled, and maybe even
justified.  Certain interior sequences are recognized both
here and in commands:
</para>
<para>
詰め込みが行われ、おそらくは均等割り付け(justified)も行われます。
内側のシーケンスの幾つかはコマンド中でも認識されます:
</para>
<verbatim><![CDATA[
I<text>     テキストをイタリックにします。強調や変数に使います
B<text>     テキストをボールドにします。スイッチやプログラムに使います
S<text>     分割不可能なスペースを含むテキスト
C<code>     コードをタイプライタフォント、または
            その他のプログラムテキストを表現する手法で描画します
L<name>     nameに対するリンク(クロスリファレンス)
		    L<name>		マニュアルページ
		    L<name/ident>	マニュアルぺージ中のアイテム
		    L<name/"sec">	他のマニュアルページにあるセクション
		    L<"sec">		同じマニュアルページのセクション
					(クォートは省略可能)
		    L</"sec">		同上
		上のものと同じだが 'text' だけが出力に使われる
		(テキストには '/' も '>'も含めることはできません。同時に
		'<'と'>'のバランスがとれていなければなりません)
		    L<text|name>
		    L<text|name/ident>
		    L<text|name/"sec">
		    L<text|"sec">
		    L<text|/"sec">
]]></verbatim>
<verbatim><![CDATA[
F<file>	ファイル名に使います
X<index>	索引のエントリ
Z<>		幅ゼロのキャラクター
E<escape>   名前付きのキャラクター(HTMLのエスケープに酷似)
		    E<lt>		リテラルの <
		    E<gt>		リテラルの >
		    E<sol>		リテラルの /
		    E<verbar>		リテラルの |
		    (これらは、他の内側のシーケンスであったり大文字が
		    先行している場合でなければ省略可能)
		    E<n>		キャラクター番号 n (おそらくASCII)
	    	    E<html>		E<Agrave>のような、非数値のHTMLエンティティ
]]></verbatim>
<para>
Most of the time, you will only need a single set of angle brackets to
delimit the beginning and end of interior sequences.  However, sometimes
you will want to put a right angle bracket (or greater-than sign '&gt;')
inside of a sequence.  This is particularly common when using a sequence
to provide a different font-type for a snippet of code.  As with all
things in Perl, there is more than one way to do it.  One way is to
simply escape the closing bracket using an <code>E</code> sequence:
</para>
<para>
たいていの場合、内部シーケンスの最初と最後のデリミタとして
1 組の山括弧のみが必要です。
しかし、時々シーケンスの中に右山括弧(または大なり記号'&gt;')を
入れたい場合があります。これはコードの断片の中で違うフォントタイプを
使いたいときによくあります。
Perl に関する他のことと同様に、やりかたはひとつではありません。
ひとつの方法は単純に閉じ括弧を <code>E</code> シーケンスを使って
エスケープする方法です:
</para>
<verbatim><![CDATA[
C<$a E<lt>=E<gt> $b>
]]></verbatim>
<para>
This will produce: &quot;<code>$a &lt;=&gt; $b</code>&quot;
</para>
<para>
これは &quot;<code>$a &lt;=&gt; $b</code>&quot; となります。
</para>
<para>
A more readable, and perhaps more &quot;plain&quot; way is to use an alternate set of
delimiters that doesn't require a &quot;&gt;&quot; to be escaped.  As of perl5.5.660,
doubled angle brackets (&quot;&lt;&lt;&quot; and &quot;&gt;&gt;&quot;) may be used <emphasis>if and only if there
is whitespace immediately following the opening delimiter and immediately
preceding the closing delimiter!</emphasis> For example, the following will do the
trick:
</para>
<para>
より読みやすく、そしておそらくより&quot;明白な&quot;方法は、別のデリミタを
使って、&quot;&gt;&quot;をエスケープしなくてもいいようにする方法です。
Perl5.5.660 以降、2 個の山括弧 (&quot;&lt;&lt;&quot; and &quot;&gt;&gt;&quot;)が使えます。
但し、<emphasis>開始デリミタの直後と終了デリミタの直前に空白があるときだけ</emphasis>です!
例えば、以下はそのトリックを使っています:
</para>
<verbatim><![CDATA[
C<< $a <=> $b >>
]]></verbatim>
<para>
In fact, you can use as many repeated angle-brackets as you like so
long as you have the same number of them in the opening and closing
delimiters, and make sure that whitespace immediately follows the last
'&lt;' of the opening delimiter, and immediately precedes the first '&gt;' of
the closing delimiter.  So the following will also work:
</para>
<para>
実際のところ、開始デリミタと終了デリミタの数さえ合っており、
開始デリミタの最後の '&lt;' の直後と 終了デリミタの最初の '&gt;' の
直前に空白が入っていれば、
山括弧の数はいくつでもかまいません。
従って、以下のものも正しく動作します:
</para>
<verbatim><![CDATA[
C<<< $a <=> $b >>>
C<<<< $a <=> $b >>>>
]]></verbatim>
<para>
This is currently supported by pod2text (Pod::Text), pod2man (Pod::Man),
and any other pod2xxx and Pod::Xxxx translator that uses Pod::Parser
1.093 or later.
</para>
<para>
これは現在のところ pod2text (Pod::Text), pod2man (Pod::Man), および
Pod::Parser 1.093 以降を使用しているその他の
pod2xxx と Pod::Xxxx が対応しています。
</para>
</sect2>
<sect2>
<title>The Intent</title>
<para>
(目的)
</para>
<para>
これだけです。強力なものではなく簡単なものを目指しています。
段落は段落らしく(矩形に)見えて欲しいので、見た目に目立ち、
fmt で簡単に再整形できるようになっています (私の vi では
F7 になっています)。
私が求めていたのは、埋め込まれるテキストの中の &quot; や ' が左のクォートか、
右のクォートかを (私の代わりに) 気遣ってくれる
トランスレータで、verbatim モードではクォートをそのままにしておいて
欲しかったのです。そうすれば、作りかけのプログラムを放り込んで、
4 カラムずらして、それをそのまま印刷すればいいのです。たぶん、
固定幅のフォントで。
</para>
<para>
特に、以下のようなものは、テキスト中にそのままにしておくことができます:
</para>
<verbatim><![CDATA[
Perl
FILEHANDLE
$variable
function()
manpage(3r)
]]></verbatim>
<para>
いずれ、別のコマンドやシーケンスを付け足さなければならなくなることは
疑いようのないことですが、これまでのところ私は意外にもこれだけで
やってきたのです。
</para>
<para>
これが本を作るのに十分だ、などと言うつもりは全くありません。
私はただ、オンラインドキュメントに使うnroff やTeXといったマークアップ言語の
ための、誰にでも使える共通のソースを作ろうとしているのです。
現在あるトランスレータには<strong>pod2man</strong>  (nroff(1) や troff(1)用),
<strong>pod2text</strong>, <strong>pod2html</strong>, <strong>pod2latex</strong>, <strong>pod2fm</strong>があります。
</para>
</sect2>
<sect2>
<title>Embedding Pods in Perl Modules</title>
<para>
(Perlモジュールへのpodの埋め込み)
</para>
<para>
Perlスクリプトにpodドキュメントを埋め込むことができます。
ドキュメントを“=head1”コマンドで始め、“=cut”で終えます。
Perlはこのようなpodテキストを無視します。
実例はあなたの使っているライブラリモジュールにあります。
もしpodテキストをファイルの末尾に置きたいというのであれば、
__END__や__DATA__というカットマークを置き、
さらに最初に現れるpodディレクティブの前に空行を置くことで行うことができます。
</para>
<verbatim><![CDATA[
__END__
]]></verbatim>
<verbatim><![CDATA[
=head1 NAME
]]></verbatim>
<verbatim><![CDATA[
modern - I am a modern module
]]></verbatim>
<para>
空行を置かなかった場合、トランスレータはpodテキストを
見失ってしまうでしょう。
</para>
</sect2>
<sect2>
<title>Common Pod Pitfalls</title>
<list>
<item><para>
Pod translators usually will require paragraphs to be separated by
completely empty lines.  If you have an apparently empty line with
some spaces on it, this can cause odd formatting.
</para>
<para>
podトランスレータは、通常は段落の分割に完全な空行を必要とします。
空白の入った見た目空行のようなものを入れると、
出力がおかしくなるかもしれません。
</para>
</item>
<item><para>
Translators will mostly add wording around a L&lt;&gt; link, so that
<code>L&lt;foo(1)&gt;</code> becomes &quot;the <emphasis>foo</emphasis>(1) manpage&quot;, for example (see
<strong>pod2man</strong> for details).  Thus, you shouldn't write things like <code>the
L&lt;foo&gt; manpage</code>, if you want the translated document to read
sensibly.
</para>
<para>
トランスレータはほとんどの場合 L&lt;&gt; リンクに語の追加を行います。
このため、たとえば <code>L&lt;foo(1)&gt;</code> は“the <emphasis>foo</emphasis>(1) manpage”と
なります(詳しくは<strong>pod2man</strong>を参照)。
したがって、あなたは変換されたドキュメントを読みやすいものにするために、
<code>the L&lt;foo&gt; manpage</code>という書き方はすべきではないのです。
</para>
<para>
If you need total control of the text used for a link in the output
use the form L&lt;show this text|foo&gt; instead.
</para>
<para>
あなたがテキストの制御全てを必要としているなら、
出力リンクのためには
L&lt;show this text|foo&gt;を使いましょう。
</para>
</item>
<item><para>
The <strong>podchecker</strong> command is provided to check pod syntax
for errors and warnings. For example, it checks for completely
blank lines in pod segments and for unknown escape sequences.
It is still advised to pass it through
one or more translators and proofread the result, or print out the
result and proofread that.  Some of the problems found may be bugs in
the translators, which you may or may not wish to work around.
</para>
<para>
<strong>podchecker</strong> コマンドは pod の文法に関するエラーと警告を
チェックするために提供されています。
例えば、pod の分割に完全な空行が使われているかや、
不明なエスケープシーケンスなどをチェックします。
それでも一つまたは複数のトランスレータに通して結果をチェックするか、
結果を印刷してそれをチェックすることをお勧めします。
発見した問題の中には、回避しようと思ったり思わなかったりするような
トランスレータのバグもあるでしょう。
</para>
</item>
</list>
</sect2>
</sect1>
<sect1>
<title>SEE ALSO</title>
<para>
<link xref='pod2man'>pod2man</link>, <link xref='perlsyn#PODs:_Embedded_Documentation'>perlsyn/&quot;PODs: Embedded Documentation&quot;</link>,
<link xref='podchecker'>podchecker</link>
</para>
</sect1>
<sect1>
<title>AUTHOR</title>
<para>
Larry Wall
</para>
<para>
Translate: 吉村 寿人 &lt;JAE00534@niftyserve.or.jp&gt;
Update: Kentaro Shirakata &lt;argrath@ub32.org&gt;
License: GPL or Artistic
</para>
</sect1>
</pod>
