Template:Samps/doc

Revision as of 16:28, 6 August 2024 by JarlPenguin (talk | contribs) (Created page with "{{documentation header}} <!-- Documentation here --> {{lua|Delimited tag}} {{see also|Template:Code}} This template is a simplified usage of {{code|<nowiki><samp>...</samp></nowiki>}}, which is used mainly to format file names and the like. == Usage == Each anonymous parameter is a string to format. Note that {{code|<nowiki>...</nowiki>}} is needed around a parameter value if it contains the pipe ({{code|{{!}}}}) or equals ({{code|{{=}}}}) symbols, or they...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This is the documentation page. It should be transcluded into Template:Samps. See Template:Documentation for more information.
This template uses Module:Delimited tag, a script written in Lua.
See also: Template:Code

This template is a simplified usage of <samp>...</samp>, which is used mainly to format file names and the like.

Usage

Each anonymous parameter is a string to format. Note that <nowiki>...</nowiki> is needed around a parameter value if it contains the pipe (|) or equals (=) symbols, or they will be treated as a parameter separator or parameter identifier, respectively. Alternatively, you could also use {{!}} or {{=}} instead.

Use the |delimiter= parameter (aliases |delim= or |d=) to change the separator between each string. Set this value to the name in words of the delimiter, such as "and", "br", "or-list", "none", etc. When using a list delimiter, use |list-level= to change the indentation (defaults to **).

Examples

  1. {{samps|text}}text
  2. {{samps|1|2|3|4|5}}1 2 3 4 5
  3. {{samps|1|2|3|4|5|delimiter=,}}1, 2, 3, 4, 5
  4. {{samps|1|2|3|4|5|delimiter=and}}1, 2, 3, 4, and 5
  5. {{samps|<nowiki>something=one|two|three</nowiki>}}something=one|two|three
  6. {{samps|something{{=}}one{{!}}two{{!}}three}}something=one|two|three

See also

  • {{samp}}, which supports attributes but can format only one string