第17章 Seam Text
多くの人が一緒に作業するウェブサイトでは、 フォーラムへの投稿、 wiki ページ、 ブログ、 コメントなどでフォーマット済みテキストの入力を容易にするために人間が扱いやすいマークアップ言語が必要です。 Seam には Seam Text と呼ばれる言語に従ったフォーマット済みテキストを表示するために
<s:formattedText/> コントロールが備わっています。 Seam Text は ANTLR ベースのパーサを利用して実装します (ANTLR に関する知識は必要ありません)。
17.1. フォーマットの基本 リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
次に簡単な例を示します。
It's easy to make *emphasized*, |monospaced|, ~deleted~, super^scripted^ or _underlined_ text.
これを
<s:formattedText/> を使って表示すると、 以下の HTML が生成されます。
<p>
It's easy to make <i>emphasized</i>, <tt>monospaced</tt>,
<del>deleted</del>, super<sup>scripted</sup> or
<u>underlined</u> text.
</p>
空行は新しいパラグラフを作成するときに使用します。 また、
+ は見出しに使用します。
+This is a big heading
You /must/ have some text following a heading!
++This is a smaller heading
This is the first paragraph. We can split it across multiple
lines, but we must end it with a blank line.
This is the second paragraph.
単なる新しい行だけなら無視されます。新しい段落にするためにテキストを配置するには空行が必要です。 これが結果となる HTML です。
<h1>This is a big heading</h1>
<p>
You <i>must</i> have some text following a heading!
</p>
<h2>This is a smaller heading</h2>
<p>
This is the first paragraph. We can split it across multiple
lines, but we must end it with a blank line.
</p>
<p>
This is the second paragraph.
</p>
# 文字は順序指定された一覧のアイテムを作成します。順序指定されていない一覧は = 文字を使います。
An ordered list:
#first item
#second item
#and even the /third/ item
An unordered list:
=an item
=another item
<p>
An ordered list:
</p>
<ol>
<li>first item</li>
<li>second item</li>
<li>and even the <i>third</i> item</li>
</ol>
<p>
An unordered list:
</p>
<ul>
<li>an item</li>
<li>another item</li>
</ul>
引用符付きのセクションは二重引用符で囲みます。
He said:
"Hello, how are /you/?"
She answered, "Fine, and you?"
<p>
He said:
</p>
<q>Hi, how are
<i>you</i>?</q>
<p>
She answered, <q>Fine, and you?</q>
</p>