< 模板:Samp
[刷新]
This is the documentation page. It should be transcluded into the main template page. See Template:Documentation for more informationSee also: Template:Code
This template is a simplified use of <samp>...</samp>. It supports as many parameters as you want; everything will be wrapped by a -{}-<samp>
element.
An optional {{{delimiter}}}
parameter can be set to specify the default space between each element.
Note that if the parameter contains a pipe symbol (-{}-|
) or an equal sign (-{}-=
), you need to surround the parameter value with -{}-< ;nowiki>...</nowiki>
, otherwise they are treated as parameter separators or parameter identifiers, respectively. Alternatively, you can instead use -{}-{{!}}
, -{}-|
, {{=}}
, and -{}-=
instead.
Examples[编辑 | 编辑源代码]
{{samp|text}}
– -{}-text{{samp|1|2|3|4|5}}
– -{}-1 2 3 4 5{{samp|1|2|3|4|5|delimiter=、}}
– -{}-1、2、3、4、5{{samp|1|2|3|4|5|d=pretty}}
– -{}-1pretty2pretty3pretty4pretty5{{samp|<nowiki>something=one|two|three<nowiki>}}
– -{}-something=one|two|three{{samp|something{{=}}one{{!}}two|three}}
– -{}-something=one|two|three