模板:As of/doc

维基百科,自由的百科全书
跳转到导航 跳转到搜索

介绍[编辑]

此模板用于标注数据的更新时间,供读者查阅或更新。

标注未来的时间不应使用此模板,而应用{{Update after}}。

语法[编辑]

  • {{As of|年}}
  • {{As of|年|月}}
  • {{As of|年|月|日}}

还可以使用下列命名参数。

参数[编辑]

必填[编辑]

  • 第一个参数:年。四位数字。

选填[编辑]

  • 第二个参数:月。英文名、英文缩写或一至二位数字。推荐使用数字格式。
  • 第三个参数:日。一至二位数字。
  • alt:以此替代模板输出的文字。
  • url:数据来源网址,供将来的编者查询并更新数据。只对已登入用户可见。网址不应含有空格。

注意[编辑]

此模板不应被替换引用

避免使用诸如{{As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}}}的代码,这与此模板的初衷相悖。

示例[编辑]

代码 效果
{{As of|2010}} 截至2010年 (2010-Missing required parameter 1=month!)
{{As of|2010|4}} 截至2010年4月 (2010-04)
{{As of|2010|Apr}} 截至2010年4月 (2010-04)
{{As of|2010|April|1}} 截至2010年4月1日 (2010-04-01)
{{As of|2010|4|1|alt=截至[[2010年美國人口普查]]}} 截至2010年美国人口普查
{{As of|2010|4|1|url=http://example.com/}} 截至2010年4月1日 (2010-04-01)

模板数据[编辑]

以下是该模板的模板数据,适用于可视化编辑器等工具。

As of模板数据

<templatedata>{ "description":"标注数据的更新时间,供读者查阅或更新。", "params": {

 "1": {
   "label": "年",
   "description": "以四位数字表示。",
   "type": "number",
   "autovalue": "{{subst:CURRENTYEAR}}",
   "required": true
 },
 "2": {
   "label": "月",
   "description": "以英文名、英文縮寫或一至二位數字表示。推荐使用数字。",
   "type" : "line",
   "autovalue": "{{subst:CURRENTMONTH}}",
   "required": false
 },
 "3": {
   "label": "日",
   "description": "一至二位数字。",
   "type": "number",
   "autovalue": "{{subst:CURRENTDAY}}",
   "required": false
 },
 "alt": {
   "label": "输出内容",
   "description": "模板输出的文字。若不指定,则输出「截至某年某月某日」。",
   "type": "line",
   "required": false
 },
 "url": {
   "label": "URL",
   "description": "数据来源网址,供将来的编者查询并更新数据。只对已登入用户可见。网址不应含有空格。",
   "type": "line",
   "required": false
 }

} }</templatedata>

参见[编辑]