Template:Code: Difference between revisions
Jump to navigation
Jump to search
创建页面,内容为“<includeonly>{{#invoke: Array | main | format=<code>%s</code> }}</includeonly><noinclude>{{documentation}} <!-- 请将分类/语言链接放在文档页面 --></noinclude>” |
m 1 revision imported |
(No difference)
|
Latest revision as of 12:29, 1 November 2024
This template uses Module:Array, this script is written in Lua.
For more details, please refer to Wikipedia:Lua and Extension:Scribunto.
此模板是-{}-<code>...</code>
的简化用法。它支持任意多个参数,所有内容都将由-{}-<code>...</code>
元素包装。
可设置一个可选的|delimiter=
参数(可缩写成|d=
),以指定每个元素之间的默认间隔符。
注意,如果参数包含管道符号(|
)或等号(=
),则需要在参数值周围加上-{}-<nowiki>...</nowiki>
,否则它们将分别被视为参数分隔符或参数标识符。另外,你也可以改用{{!}}
, |
, {{=}}
and =
代替。
示例
- {{code|text}} –
text
- {{2:code|1}} –
1
2
3
4
5
- {{2:code|1}} –
1
、2
、3
、4
、5
- {{2:code|1}} –
1
,2
,3
,4
and5
- {{two:code|<nowiki>something=one}} –
something=one|two|three
- {{code|something{{=}}one{{!}}two|three}} –
something=one|two|three
[ View | Edit | History | Purge ]The above documentation is transcluded from Template:Code/doc.