Help:Lists/ja

このページでは MediaWiki でのリスト (一覧、列挙) の作成を扱います.

リストの基本
を使うと、以下に示す3種類のリストをつくることができます: 番号なしリスト、番号つきリスト、定義リスト

基本事項

 * 番号なしリスト
 * 各リストアイテムは、アスタリスク  で始まる行に記します. 例：


 * 番号つきリスト
 * 各リストアイテムは、ハッシュ  で始まる行に記します. 例：


 * 定義リスト
 * 各項目は 用語 と 説明 の2つの部分で構成されています.
 * The term is on a new line starting with a semicolon  e.g..
 * 説明 は、同じ行でコロン  に続けて記します. 例：
 * または、説明 を、コロン  で始まる独立した行に記します. 例： （各用語には複数の説明を設けることもでき、それぞれの説明文はコロンで始まる行に記します）.

もう少し詳細な話
以下の表に、いくつかの事例について記述方法を表示結果を示します.

リストに複数行
簡略化のために、wikiマークアップのリストアイテムは段落より長くすることはできません. リストの後に空白行があるとリストは終了し、番号付きリストの番号はリセットされます. 番号なしリスト項目を分離しても、通常は特に目立った効果はありません.

HTMLタグを使えば、リスト内に段落を強制的に挿入することができます. 複数行のテキストを記述したいなら、改行記号を2つ、つまり  を追加してください. テキストをで囲むと、そのテキストは新しい段落となり、独立した行として表示されます.

Continuing a list item after a sub-item
In HTML, a list item may contain several sublists, not necessarily adjacent; thus there may be parts of the list item not only before the first sublist, but also between sublists, and after the last one. However, in wiki-syntax, sublists follow the same rules as sections of a page: the only possible part of the list item not in sublists is before the first sublist.

In the case of an unnumbered first-level list in wikitext code this limitation can be overcome by splitting the list into multiple lists; indented text between the partial lists may visually serve as part of a list item after a sublist; however, this may give, depending on CSS, a blank line before and after each list, in which case, for uniformity, every first-level list item could be made a separate list.

Numbered lists illustrate that what should look like one list may, for the software, consist of multiple lists; unnumbered lists give a corresponding result, except that the problem of restarting with 1 is not applicable.

One level deeper, with a sublist item continuing after a sub-sublist, one gets even more blank lines; however, the continuation of the first-level list is not affected:

も参照してください.

It is possible to embed unnumbered bullets inside enclosing numbered items:

Per list
The list type (which type of marker appears before the list item) can be changed in CSS by setting the list-style-type property:

Site-wide
The standard #, ##, ### wikitext can be used alongisde CSS in MediaWiki:Common.css to produce the usual system of numbered lists (1, 2, 3; then a, b, c; then i, ii, iii):

The first  above is the default, so not necessary unless some other list-style-type is required.

リスト内の字下げを増やす
In a numbered list in a large font, some browsers do not show more than two digits, unless extra indentation is applied (if there are multiple colons: for each colon). This can be done with CSS:

or alternatively, like below.

To demonstrate that all three methods show all digits of 3-digit numbers, see List demo.

Specifying a starting value
Specifying a starting value is possible with HTML syntax.

または:

表組みとの比較
Apart from providing automatic numbering, the numbered list also aligns the contents of the items, comparable with using table syntax:

gives:

This non-automatic numbering has the advantage that if a text refers to the numbers, insertion or deletion of an item does not disturb the correspondence.

複数列のリスト
Template:Col-begin, Template:Col-break, Template:Col-endも参照してください.

複数列の中黒付き箇条書き
gives:


 * 林檎
 * じゅうたん
 * 地理
 * 山脈
 * どこでもない
 * 切手
 * ぎざぎざ
 * トースト

gives:


 * 林檎
 * じゅうたん
 * 地理
 * 山脈
 * どこでもない
 * 切手
 * ぎざぎざ
 * トースト

複数列の番号付き箇条書き
gives:


 * 林檎
 * じゅうたん
 * 地理
 * 山脈
 * どこでもない
 * 切手
 * ぎざぎざ
 * トースト

Below a starting value is specified, with HTML-syntax (for the first column either wiki-syntax or HTML-syntax can be used).

In combination with the extra indentation explained in the previous section:

gives

Using the computation of the starting values can be automated, and only the first starting value and the number of items in each column except the last has to be specified. Adding an item to, or removing an item from a column requires adjusting only one number, the number of items in that column, instead of changing the starting numbers for all subsequent columns.

gives:

gives:

gives:

gives:

Streamlined style or horizontal style
It is also possible to present short lists using very basic formatting, such as:

Title of list: example 1, example 2, example 3

Title of list: example 1, example 2, example 3

This style requires less space on the page, and is preferred if there are only a few entries in the list, it can be read easily, and a direct edit point is not required. The list items should start with a lowercase letter unless they are proper nouns.

Tables
A one-column table is very similar to a list, but it allows sorting. If the wikitext itself is already sorted with the same sortkey, this advantage does not apply. A multiple-column table allows sorting on any column.

表組みを使う条件も参照してください.

Changing unordered lists to ordered ones
With the CSS

unordered lists are changed to ordered ones. This applies (as far as the CSS selector does not restrict this) to all ul-lists in the HTML source code:


 * those produced with *
 * those with in the wikitext
 * those produced by the system

Since each special page, like other pages, has a class based on the pagename, one can separately specify for each type whether the lists should be ordered, see User contributions and What links here.

However, it does not seem possible to make all page history lists ordered (unless one makes all lists ordered), because the class name is based on the page for which the history is viewed.

関連項目

 * Wikipedia help page about lists
 * Module:Sort definition list - Scribuntoモジュールは定義リストを定義語に基づいて並べ替えることができ、多言語ウィキで便利に使える.