Template:Version

维基百科,自由的百科全书
跳转至: 导航搜索
Documentation icon 模板文档[查看] [编辑] [页面历史] [清除]

Usage[编辑]

This template presents version history tables in a standardized format.

Many articles on Wikipedia use color-coded tables to illustrate the version or release history of software. The template has been imported from German Wikipedia, where it is used as the current standard for color-coding history tables.

This template is used within Wikitables, making use of the pipe syntax. Legends can be added as tables, as floating or non-floating containers. As colors are visible to blind or visually-impaired readers, this template uses replacement information when necessary to improve accessibility, e.g. using the "title" attribute. (See Wikipedia:WikiProject Accessibility)

When creating a version history, please note that less is more: Wikipedia is not a directory or changelog. Only important or major releases should be documented in Wikipedia. See the Manual of Style for Computing topics for further guidelines.

General look[编辑]

Version Year Description
老版本,不再支持: 1.0 2010 Old version
老版本,仍被支持: 1.8 2011 Older version, yet still supported
当前稳定版本: 2.0 2012 Current stable version
未来版本: 3.0 2017 Future release
格式:
老版本
老版本,仍被支持
当前版本
最新的预览版
未来版本

When to avoid[编辑]

Discontinued products
For a product that is neither supported nor developed, each version would have the "old version, unsupported" description. Since no distinction would exist between version stages, the use of this template would lack any basis. A simple sentence or a |discontinued=yes in the infobox would do admirably well.
When there is always one stable supported version
When there are no supported previous versions, preview versions or announced future versions, the entire table would consist of red versions with a single green one at the very end. In such cases, the use of this template is discouraged.

Parameters[编辑]

Parameter Description Notes
1 Data type Specifies the type of content this template generates. Either of the following indicate that this template should change the background color of the cell in which it is inserted. Acceptable values include:
o: Denotes old version, unsupported
co: Denotes old version, still supported
c: Denotes latest stable version
cp: Denotes preview version
p: Denotes planned future version

Either of the following indicate that this template generates a color legend (see examples). Acceptable values include:

l: Horizontal legend
lv: Vertical legend
t: Horizontal legend, as a table
tv: Vertical legend, as a table

See examples below to see how they look.

2 Text Specifies the text to display on screen, usually a version number or name of a specific version. It is only effective when the first unnamed parameter (data type) is set to either "o", "co", "c", "cp" or "p".
show Legend options Specifies the contents of the legend that this template should generate. It is only effective when the first unnamed parameter (data type) is set to either "l", "lv", "t" or "tv". Acceptable parameter is a six-digit number when data type is either "l" or "lv" or a five-digit number when data type is either "t" or "tv". Acceptable digits are "1" (displays the associated legend item) and "0" (hides the associated legend item).

The following is list of items associated with a digit when data type is set to "l" or "lv", in order from left to right:

格式:
老版本
老版本,仍被支持
当前版本
最新的预览版
未来版本
  1. Legend:
  2. Old version
  3. Older version, still supported
  4. Latest version
  5. Latest preview version
  6. Future release

The following is list of items associated with a digit when data type is set to "t" or "tv", in order from left to right:

Legend:
老版本
老版本,仍被支持
当前版本
最新的预览版
未来版本
  1. Old version
  2. Older version, still supported
  3. Current version
  4. Latest preview version
  5. Future release

The top cell (heading/"Legend") cannot be hidden.

style CSS styles This parameter is optional. Use to change the template's formatting, style and layout via CSS syntax. This parameter can be inserted into the table cell to use enforces CSS definitions in a cell. In combination with the legend, however, the specified CSS applies to the entire block.
sortKey Optional sorting key This parameter is only effective the data type parameter is set to "o", "co", "c", "cp" and "p". A sortkey is an invisible string used to change the way a certain table cell is sorted. For instance, normally, the phrase "ACME's Bow" is sorted with phrases that start with A. Affixing a sortkey of "Bow" to the phrase causes the phrase to be sorted with other phrases that start with "B" (or, to be more accurate, with "Bow").

For general information on sorting tabels, see Help:Tables.

Commonly used forms[编辑]

Legends[编辑]

{{Version|l}}
{{Version|lv}}
{{Version|t}}
{{Version|tv}}

Configure the display of the individual version stages

{{Version|l}}
{{Version|lv}}
{{Version|t}}
{{Version|tv}}

Version stages[编辑]

{{Version|o|}}
{{Version|co|}}
{{Version|c|}}
{{Version|cp|}}
{{Version|p|}}

Examples[编辑]

Legends[编辑]

Description What you type What it looks like
Horizontal legend
{{Version |l |show=010111}}
格式:
老版本
老版本,仍被支持
当前版本
最新的预览版
未来版本
Vertical legend
{{Version |lv |show=011101}}
格式:
老版本
老版本,仍被支持
当前版本
最新的预览版
未来版本
本文为測試文字。这段文字用于说明格式,请勿删除。這段文字用於說明格式,請勿刪除。海納百川,有容乃大。維基百科,自由的百科全書。
Horizontal legend table
{{Version |t |show=111001}}
Legend: 老版本 老版本,仍被支持 当前版本 最新的预览版 未来版本
Vertical legend table
{{Version |tv |show=101111}}
Legend:
老版本
老版本,仍被支持
当前版本
最新的预览版
未来版本
本文为測試文字。这段文字用于说明格式,请勿删除。這段文字用於說明格式,請勿刪除。海納百川,有容乃大。維基百科,自由的百科全書。本文为測試文字。这段文字用于说明格式,请勿删除。這段文字用於說明格式,請勿刪除。海納百川,有容乃大。維基百科,自由的百科全書。

Cell colors[编辑]

Description What you type What it looks like
Old version, unsupported
{{Version |o |1.0}}
老版本,不再支持: 1.0
Old version, still supported
{{Version |co |2.0}}
老版本,仍被支持: 2.0
Latest stable version
{{Version |c |3.0}}
当前稳定版本: 3.0
Preview version
{{Version |cp |4.0}}
最新的预览版: 4.0
Planned future version
{{Version |p |5.0}}
未来版本: 5.0

Sortable tables[编辑]

The template can be used in sortable tables. If the column version is sortable, the sort key defaults to the value of the version parameter. If you need differing sorting, add the sortKey parameter as follows:

What you type What it looks like
{| class="wikitable sortable"
|-
! Version !! Date !! Description
|-
| {{Version  |o  |1.0    |sortKey=1.0}}
| 2010-07-23 || Old version, unsupported
|-
| {{Version  |co |2.0    |sortKey=2.0}}
| 2011-06-27 || Old version, still supported
|-
| {{Version  |cp |3.0 DP |sortKey=3.0 A}}
| 2012-03-02 || Developer's preview
|-
| {{Version  |cp |3.0 CP |sortKey=3.0 B}}
| 2012-04-01 || Consumers Preview
|-
| {{Version  |cp |3.0 RC |sortKey=3.0 C}}
| 2012-05-25 || Release candidate
|-
| {{Version  |c  |3.0    |sortKey=3.0 Z}}
| 2012-06-23 || Release to web
|-
| {{Version  |p  |4.0    |sortKey=4.0}}
| 2013-13-13 || Future version
|}
Version Date Description
老版本,不再支持: 1.0 2010-07-23 Old version, unsupported
老版本,仍被支持: 2.0 2011-06-27 Old version, still supported
最新的预览版: 3.0 DP 2012-03-02 Developer's preview
最新的预览版: 3.0 CP 2012-04-01 Consumers Preview
最新的预览版: 3.0 RC 2012-05-25 Release candidate
当前稳定版本: 3.0 2012-06-23 Release to web
未来版本: 4.0 2013-13-13 Future version

See also[编辑]