2016-11-08

PHP Markdown Extra テキトー訳 (4)

Definition Lists


PHP Markdown Extraでは定義リストを実装している。定義リストは用語で構成され、それらの定義で構成されている辞書のようなものだ。


 


簡単な定義リストは1行の用語と次の行の先頭にコロン(:)を付けて定義文を書く。


Apple
:     Pomaceous fruit of plants of the genus Malus
      in the family Rosacase.

Orange
:     The fruit of an evergreen tree of the genus Citris.

 用語は前の用語との間に空改行を入れないといけない。定義は複数業にまたがってもいい。その場合はインデントされているべきだ。しかし、いい加減に書きたいならば、このインデントは忘れてくれても大丈夫さ、その場合はこうなる:


Apple
:     Pomaceous fruit of plants of the genus Malus
in the family Rosacase.

Orange
:     The fruit of an evergreen tree of the genus Citris.

 これが...こうだ!


<dl>
<dt>Apple</dt>
<dd>Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.</dd>

<dt>Orange</dt>
<dd>The fruit of an evergreen tree of the genus Citrus.</dd>
</dl>

 定義マーカーとしてのコロンは通常左端から始まり、3つ以内のスペースでインデントして定義を書く。


 


定義リスト1語で複数の定義を持つこともできる。こんな感じに


Apple
:    Pomaceous fruit of plants of the genus Malus
     in the family Rosacase.
:    An American computer company.

Orange
:    The fruit of an evergreen tree of the genus Citris.

 また、複数の用語で構成する事さえできる。


Term 1
Term 2
:    Definition a

Term 3
:    Definition b

もし、定義が空改行で始まっていると、PHP Markdown Extraはその定義を<p>タグで囲む。例えばこう、


Apple

: Pomaceous fruit of plants of the genus Malus
in the family Rosacase.

Orange

: The fruit of an evergreen tree of the genus Citris.

 こうすると、こう返ってくる。



<dl>
<dt>Apple</dt>
<dd>
<p>Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.</p>
</dd>

<dt>Orange</dt>
<dd>
<p>The fruit of an evergreen tree of the genus Citrus.</p>
</dd>
</dl>


そしていわゆるリストアイテムのように、定義は複数行のパラグラフを持つ事ができるし、<blockquote>,<code>,<ul><li>のようなブロック要素を内包する事もできる。



Term 1

dolor sit amet, consectetuer adipiscing elit. Aliquam
hendrerit mi posuere lectus.

Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus.

because of the blank line preceding it.

Term 2


code block.

> block quote
> on two lines.

1. first list item
2. second list item


 


今日はここまで。。。


0 件のコメント :

コメントを投稿