第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>
Copy to Clipboard Toggle word wrap
空行は新しいパラグラフを作成するときに使用します。 また、+ は見出しに使用します。
        +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.
Copy to Clipboard Toggle word wrap
単なる新しい行だけなら無視されます。新しい段落にするためにテキストを配置するには空行が必要です。 これが結果となる 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>
Copy to Clipboard Toggle word wrap
# 文字は順序指定された一覧のアイテムを作成します。順序指定されていない一覧は = 文字を使います。
        An ordered list:
        
        #first item
        #second item
        #and even the /third/ item

        An unordered list:

        =an item
        =another item
Copy to Clipboard Toggle word wrap
<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>
Copy to Clipboard Toggle word wrap
引用符付きのセクションは二重引用符で囲みます。
        He said:
        
        "Hello, how are /you/?"

        She answered, "Fine, and you?"
Copy to Clipboard Toggle word wrap
<p>
  He said:
</p>
        
<q>Hi, how are
<i>you</i>?</q>

<p>
  She answered, <q>Fine, and you?</q>
</p>
Copy to Clipboard Toggle word wrap
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat