Template:Code/doc

Revision as of 12:29, 1 November 2024 by Selfice (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
[ Purge ]
This is the documentation page, it should be placed in should. See Template:Documentation for more information.

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>,否则它们将分别被视为参数分隔符或参数标识符。另外,你也可以改用{{!}}, &#124;, {{=}} and &#61;代替。

示例

  • {{code|text}} – text
  • {{2:code|1}} – 12345
  • {{2:code|1}} – 12345
  • {{2:code|1}} – 1, 2, 3, 4 and 5
  • {{two:code|<nowiki>something=one}} – something=one|two|three
  • {{code|something{{=}}one{{!}}two&#124;three}} – something=one|two|three


en:Template:Code/doc