文档图示 模板文档[查看] [编辑] [历史] [清除缓存]

使用 编辑

给编辑者 编辑

普通使用 编辑

使用该系统的所有模板具有相同的用法。输出将根据您提供的信息而变化:

  • “年”类型:须提供century、decade和year的值。
  • “年代”类型:须提供century和decade的值。
  • “世纪”类型:只提供century的值。

举例:

1985年:
{{births by year
 |century = 19
 |decade  = 8
 |year    = 5
}}

1980年代:
{{births by year
 |century = 19
 |decade  = 8
 |year    = 
}}

20世紀:
{{births by year
 |century = 19
 |decade  = 
 |year    = 
}}

50年:
{{births by year
 |century =
 |decade  = 5
 |year    = 0
}}

前1250年代:

{{births by year
 |century = 12
 |decade  = 5
 |year    =
 |era     = BCE
}}

1世纪 编辑

在(前)1世纪、(前)0年代时,需要视情况将century和decade留空,因为数字不存在(例如,第5年没有十位数)。

0年代(包含西元1年~9年)
{{births by year
 |century = 
 |decade  = 0
 |year    = 
}}

1世紀
{{births by year
 |century = 
 |decade  = 
 |year    = 
}}

给开发者 编辑

注意:
此模板不应由普通编辑直接修改;如果您要查找{{births by year}}等模板上的文档,请参阅上面的章节。 目前,以下模板使用此系统:

使用 编辑

此模板用作特定模板的一部分,如{{deaths by year}},以生成日期类别(世纪,年代,年份)的列表。 它从提供的信息量中推断出深度。 以下代码是标准代码(可根据需要更改数值):

{{categories by date
 |century = {{{century}}}
 |decade  = {{{decade}}}
 |year    = {{{year}}}
 |caption = Authors who died
 |name    = deaths
 |parentcat = Authors by date
 |era     = {{#switch:{{{era|}}}|BCE|BC=BCE}}
}}
  • {{{century}}}{{{decade}}}{{{year}}}:日期分为世纪,年代和年份三个数字。
  • {{{caption}}}:用作类别描述的一部分的文字。在中文版大多不使用
  • {{{name}}}:类别中使用的文字。耴[[Category:1986年{逝世}]]。
  • {{{parentcat}}}:包含当前日期类别系统的母分类。
  • {{{era}}}:切换是否将“BCE”添加到类别名称。

嵌套模板 编辑

此模板使用嵌套模板{{categories by date/list}}来生成类别列表。这个嵌套模板以最小化计算的方式操作参数:

  • {{{1}}} (prefix digits): the digits of the year, excepting the last number.
  • {{{2}}} (suffix): text to add after the date; for example, s in 1980s works.
  • {{{3}}} (category label): the text in the category names; for example, works in 1980 works.
  • {{{4}}} (era):是否加入“前”。
Purpose Code Output
Common era
list years {{categories by date/list|198||deaths}}

1980

1981

1982

1983

1984

1985

1986

1987

1988

1989

list decades {{categories by date/list|19|0s|deaths}}

190

191

192

193

194

195

196

197

198

199

Before common era
list years {{categories by date/list|50||deaths|BCE}}

500

501

502

503

504

505

506

507

508

509

list decades {{categories by date/list|5|0s|deaths|BCE}}

50

51

52

53

54

55

56

57

58

59

参见 编辑