Template:Samp/doc

Revision as of 15:27, 6 August 2024 by JarlPenguin (talk | contribs) (Created page with "{{documentation header}} <!-- Documentation here --> {{see also|Template:Code}} This template is a simplified usage of {{code|<nowiki><samp>...</samp></nowiki>}}, which is used to format sample outputs. Usage of samp is deprecated for filenames, so use {{t|mono}} instead. == Usage == The first 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 equa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This is the documentation page. It should be transcluded into Template:Samp. See Template:Documentation for more information.
See also: Template:Code

This template is a simplified usage of <samp>...</samp>, which is used to format sample outputs. Usage of samp is deprecated for filenames, so use {{mono}} instead.

Usage

The first 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.

Examples

  • {{samp|text}}text
  • {{samp|error|color=red}}error

See also

  • {{samps}}, which can format multiple strings but does not support attributes