跳转到内容

Template:Para/doc:修订间差异

维基百科,自由的百科全书
删除的内容 添加的内容
无编辑摘要
A2093064-bot留言 | 贡献
機器人35:更新模板使用量為130375
 
(未显示3个用户的12个中间版本)
第4行: 第4行:
}}
}}
{{Documentation subpage}}
{{Documentation subpage}}
{{High-use|78,000+}}
{{High-use|130375}}
<!-- 在本行下編輯模板說明 -->
<!-- 在本行下編輯模板說明 -->
<includeonly>{{Distinguish|Template:Paragraph break|Template:Param}}</includeonly>
<includeonly>{{Distinguish|Template:Paragraph break|Template:Param|Template:參數}}</includeonly>
== Usage ==
==用法==
This template is for giving examples of [[Wikipedia:Template messages|template]] parameter source code (useful in template documentation and talk page discussions of template code). It must have one or two parameters itself. The first parameter is the name of the example parameter to display (this may be ''empty'', but it must be ''present''), and the second (optional) parameter is a value for the first example parameter or, if the first {{tlx|para}} parameter is empty, an unnamed example parameter.
This template is for giving examples of [[Wikipedia:Template messages|template]] parameter source code (useful in template documentation and talk page discussions of template code). It must have one or two parameters itself. The first parameter is the name of the example parameter to display (this may be ''empty'', but it must be ''present''), and the second (optional) parameter is a value for the first example parameter or, if the first {{tlx|para}} parameter is empty, an unnamed example parameter.


=== Examples ===
===舉例===
{| class="wikitable"
{| class="wikitable"
! 原始碼
! Code
! Result
! 結果
! Notes
! 備註
|-
|-
| {{tlx|para|name}}
| {{tlx|para|name}}
| {{para|name}}
| {{para|name}}
|
|
|-
|-
| <code><nowiki>{{para|title|{{var|book title}}}}</nowiki></code>
| <code><nowiki>{{para|title|{{var|book title}}}}</nowiki></code>
| {{para|title|{{var|book title}}}}
| {{para|title|{{var|book title}}}}
|
|
|-
|-
| {{tlx|para|2=<span style="font-size:1pt;">&nbsp;</span>|3=section}}
| {{tlx|para|2=<span style="font-size:1pt;">&nbsp;</span>|3=section}}
| {{para||section}}
| {{para||section}}
| For [[Help:Templates#Parameters|unnamed parameters]]; note empty first parameter in the code
| For[[:en:Help:Templates#Parameters|未命名的參數]]; note empty first parameter in the code
|-
|-
| <code><nowiki>{{para|{{var|parameter}}|{{var|value}}}}</nowiki></code>
| <code><nowiki>{{para|{{var|parameter}}|{{var|value}}}}</nowiki></code>
| {{para|{{var|parameter}}|{{var|value}}}}
| {{para|{{var|parameter}}|{{var|value}}}}
|
|
|}
|}
When using literal, pre-specified values, simply provide the value (as in the third example above). When illustrating hypothetical, variable, or user-definable values, use {{tlx|var|value}} (as in the second example above). The same should be done for non-literal, example parameters (fourth example above).
When using literal, pre-specified values, simply provide the value (as in the third example above). When illustrating hypothetical, variable, or user-definable values, use {{tlx|var|value}} (as in the second example above). The same should be done for non-literal, example parameters (fourth example above).


== See also ==
==參見==
See also the three tables below; they describe the family of approximately forty templates built for talking about templates.

Here are some related templates or subjects not found in the tables:
* {{tl|Param}}
* {{tl|Param}}
* {{tl|tag}}<!---, for providing a similar service, but for HTML tags.--->
* {{tl|Parameter}}
* {{tl|tag}}, for providing a similar service, but for HTML tags<!--


This area creates a more user friendly gap to clearly isolate area for adding See also entries.


<includeonly>{{sandbox other||
<includeonly>{{sandbox other||
<!-- 本行下加入模板的分類,跨維基連結加入Wikidata(參見[[Wikipedia:Wikidata]]) -->
<!---本行下加入模板的分類,跨維基連結加入Wikidata(參見[[Wikipedia:Wikidata]])--->
[[Category:輸入支援模板]]
[[Category:輸入支援模板]]
[[Category:格式模板]]
[[Category:格式模板]]

2021年2月21日 (日) 21:09的最新版本

用法

[编辑]

This template is for giving examples of template parameter source code (useful in template documentation and talk page discussions of template code). It must have one or two parameters itself. The first parameter is the name of the example parameter to display (this may be empty, but it must be present), and the second (optional) parameter is a value for the first example parameter or, if the first {{para}} parameter is empty, an unnamed example parameter.

舉例

[编辑]
原始碼 結果 備註
{{para|name}} |name=
{{para|title|{{var|book title}}}} |title=book title
{{para| |section}} |section For未命名的參數; note empty first parameter in the code
{{para|{{var|parameter}}|{{var|value}}}} |parameter=value

When using literal, pre-specified values, simply provide the value (as in the third example above). When illustrating hypothetical, variable, or user-definable values, use {{var|value}} (as in the second example above). The same should be done for non-literal, example parameters (fourth example above).

參見

[编辑]