模板:Parameters/doc

使用方式

{{Parameters}}用于提取指定模板的参数,以帮助撰写模板文档,或帮助页面存废讨论合并提名。参数|1=为输出格式,|base=为指定模板的名称。compare(对比)功能需要第三个参数|other=。{{Parameters}}必须替换引用

常见用例

  • 要在模板文档中添加{{Parameter names example}},使用:{{subst:Parameters|demo|base={{subst:BASEPAGENAME}}}}
  • 要记录模板用法,使用:{{subst:Parameters|code|base={{subst:BASEPAGENAME}}}}

选项

check

生成对Module:Check for unknown parameters的调用,可附于模板以检测未知参数的使用。

{{subst:Parameters|check|base={{subst:BASEPAGENAME}}}}
生成的示例
{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:使用未知Infobox high court参数的页面|_VALUE_{{PAGENAME}}]]}}|preview=页面使用了[[Template:Infobox high court]]不存在的参数"_VALUE_"|ignoreblank=y|court_name|native_name|image|imagesize|width|height|caption|image2|imagesize2|caption2|established|dissolved|country|location|coordinates|motto|type|at|authority|appeals|terms|positions|budget|website|chiefjudgetitle|chiefjudgename|termstart|termend|termend2|chiefjudgetitle2|chiefjudgename2|termstart2|termend3|termend4}}

code

生成指定模板的空白模板,可添加到模板文档中。使用|pad=yes以使等号对齐;使用|definitions=yes以自动生成部分参数的释义。

{{subst:Parameters|code|base={{subst:BASEPAGENAME}}}}
示例:{{subst:Parameters|code|base=Infobox court|pad=yes}}
{{Infobox court
| court_name        = 
| native_name       = 
| image             = 
| imagesize         = 
| alt               = 
| caption           = 
| image2            = 
| imagesize2        = 
| alt2              = 
| caption2          = 
| established       = 
| dissolved         = 
| jurisdiction      = 
| location          = 
| coordinates       = 
| motto             = 
| type              = 
| at                = 
| authority         = 
| appealsto         = 
| appeals           = 
| appealsfrom       = 
| terms             = 
| positions         = 
| budget            = 
| language          = 
| tribunal-type     = 
| website           = 
| chiefjudgetitle   = 
| chiefjudgename    = 
| termstart         = 
| termend           = 
| termend2          = 
| chiefjudgetitle2  = 
| chiefjudgename2   = 
| termstart2        = 
| termend3          = 
| termend4          = 
| chiefjudgetitle3  = 
| chiefjudgename3   = 
| termstart3        = 
| termend5          = 
| division_map      = 
| division_map_size = 
| division_map_alt  = 
| division_caption  = 
}}

flatcode

生成指定模板的空白模板,可添加到模板文档中。

{{subst:Parameters|flatcode|base={{subst:BASEPAGENAME}}}}
示例:{{subst:Parameters|flatcode|base=color}}

自动生成:

{{color |1=1|2=2}}

手动修饰后:

{{color |1=color|2=text}}

demo

生成{{Parameter names example}}的调用,可添加到模板文档中。

{{subst:Parameters|demo|base={{subst:BASEPAGENAME}}}}
示例:{{subst:Parameters|demo|base=Infobox court}}
{{{court_name}}}
{{{native_name}}}
[[File:{{{image}}}| {{{imagesize}}}]]
{{{caption}}}
[[File:{{{image2}}}|{{{imagesize2}}}]]
{{{caption2}}}
设立{{{established}}}
司法管辖权{{{jurisdiction}}}
所在地{{{location}}}
经纬度{{{coordinates}}}
法官选任方式{{{type}}}
设立法源{{{authority}}}
上诉法院{{{appeals}}}
法官任期{{{terms}}}
法官人数{{{positions}}}
网址{{{website}}}
{{{chiefjudgetitle}}}
现任{{{chiefjudgename}}}
首长上任时间{{{termstart}}}
首长卸任时间{{{termend}}}
法官上任时间{{{termstart2}}}
法官卸任时间{{{termend2}}}

dlist

生成一个参数描述列表,供填写后添加到模板文档中。输出使用分号和冒号格式,参数名称以粗体显示,描述以缩进显示。

{{subst:Parameters|dlist|base={{subst:BASEPAGENAME}}}}
示例:{{subst:Parameters|dlist|base=Infobox court}}
court_name
native_name
image
imagesize
alt
caption
image2
imagesize2
alt2
caption2
established
dissolved
jurisdiction
location
coordinates
motto
type
at
authority
appealsto
appeals
appealsfrom
terms
positions
budget
language
tribunal-type
website
chiefjudgetitle
chiefjudgename
termstart
termend
termend2
chiefjudgetitle2
chiefjudgename2
termstart2
termend3
termend4
chiefjudgetitle3
chiefjudgename3
termstart3
termend5
division_map
division_map_size
division_map_alt
division_caption

dlistpara

生成一个参数描述列表,供填写后添加到模板文档中。输出使用分号和冒号格式,参数名称使用{{para}}模板,描述以缩进显示。

{{subst:Parameters|dlistpara|base={{subst:BASEPAGENAME}}}}
示例:{{subst:Parameters|dlistpara|base=Infobox court}}
|court_name=
|native_name=
|image=
|imagesize=
|alt=
|caption=
|image2=
|imagesize2=
|alt2=
|caption2=
|established=
|dissolved=
|jurisdiction=
|location=
|coordinates=
|motto=
|type=
|at=
|authority=
|appealsto=
|appeals=
|appealsfrom=
|terms=
|positions=
|budget=
|language=
|tribunal-type=
|website=
|chiefjudgetitle=
|chiefjudgename=
|termstart=
|termend=
|termend2=
|chiefjudgetitle2=
|chiefjudgename2=
|termstart2=
|termend3=
|termend4=
|chiefjudgetitle3=
|chiefjudgename3=
|termstart3=
|termend5=
|division_map=
|division_map_size=
|division_map_alt=
|division_caption=

list

生成一个参数描述列表,供填写后添加到模板文档中。与dlist类似,但使用星号生成项目符号列表。

{{subst:Parameters|list|base={{subst:BASEPAGENAME}}}}
示例:{{subst:Parameters|list|base=Infobox court}}
  • court_name
  • native_name
  • image
  • imagesize
  • alt
  • caption
  • image2
  • imagesize2
  • alt2
  • caption2
  • established
  • dissolved
  • jurisdiction
  • location
  • coordinates
  • motto
  • type
  • at
  • authority
  • appealsto
  • appeals
  • appealsfrom
  • terms
  • positions
  • budget
  • language
  • tribunal-type
  • website
  • chiefjudgetitle
  • chiefjudgename
  • termstart
  • termend
  • termend2
  • chiefjudgetitle2
  • chiefjudgename2
  • termstart2
  • termend3
  • termend4
  • chiefjudgetitle3
  • chiefjudgename3
  • termstart3
  • termend5
  • division_map
  • division_map_size
  • division_map_alt
  • division_caption

compare

生成两个不同模板中可用参数的对比。

{{subst:Parameters|compare|base=Infobox London station|other=Infobox station}}
Output
Identical:
* borough
* caption
* events1
* events10
* events11
* events2
* events3
* events4
* events5
* events6
* events7
* events8
* events9
* latitude
* longitude
* map_type
* name
* original
* platforms
* postgroup
* pregroup
* symbol
* symbol2
* symbol3
* symbol4
* tracks
* years1
* years10
* years11
* years2
* years3
* years4
* years5
* years6
* years7
* years8
* years9

Similar:
* events12; events13; events14; events15 < events; events1; events2; events3; events4; events5; events6; events7; events8; events9; events10; events11 [events]
* years12; years13; years14; years15 < years; years1; years2; years3; years4; years5; years6; years7; years8; years9; years10; years11 [years]

Disparate:
* access
* access_note
* alt_name
* alt_name1
* coord_region
* ctbat0910
* ctbat1011
* cyclepark
* dft_category
* dlrbat0708
* dlrbat0809
* dlrbat1011
* fare_zone
* fare_zone_1
* fare_zone_note
* gridref
* image_alt
* image_name
* image_size
* imagesize
* interchange
* interchange1
* interchange2
* interchange3
* interchange4
* interchange5
* interchange_note
* label_position
* listing_amended
* listing_detail
* listing_entry
* listing_grade
* listing_reference
* listing_start
* locale
* manager
* manager1
* manager2
* owner
* owner1
* owner2
* railcode
* railcode1
* railcode2
* railexits0203
* railexits0405
* railexits0506
* railexits0607
* railexits0708
* railexits0809
* railexits0910
* railexits1011
* railexits1112
* railexits1213
* railexits1314
* railint0203
* railint0405
* railint0506
* railint0607
* railint0708
* railint0809
* railint0910
* railint1011
* railint1112
* railint1213
* railint1314
* raillowexits0203
* raillowexits0405
* raillowexits0506
* raillowexits0607
* raillowexits0708
* raillowexits0809
* raillowexits0910
* raillowexits1011
* raillowexits1112
* raillowexits1213
* raillowexits1314
* raillowint0203
* raillowint0405
* raillowint0506
* raillowint0607
* raillowint0708
* raillowint0809
* raillowint0910
* raillowint1011
* raillowint1112
* raillowint1213
* raillowint1314
* railstation
* replace
* toilets
* tubeexits03_ref
* tubeexits04_ref
* tubeexits05_ref
* tubeexits06_ref
* tubeexits03
* tubeexits04
* tubeexits05
* tubeexits06
* tubeexits07
* tubeexits08
* tubeexits09
* tubeexits10
* tubeexits11
* tubeexits12
* tubeexits13