الگو:Samp

از ویکی‌پدیا، دانشنامهٔ آزاد

{{{1}}}

توضیحات الگو[نمایش] [ویرایش] [تاریخچه] [پاکسازی]

Purpose[ویرایش]

This template is for explicitly indicating that the content inside it represents example output from a computer program or other machine source (automated attendant/interactive voice response call system, exit code of an application, standard output, LCD display, etc.) It uses the [اکس‌اچ‌تی‌ام‌ال]اچ‌تی‌ام‌ال element <samp>...</samp> (sample output) which exists for this purpose, and applies some styling to it, namely a faint greying out of the text color to visually difference it from source code and input. It retains the default monospaced (non-proportional) font style of the <samp> element. Because it uses <samp>...</samp> instead of simply applying visual style effects, it is semantic markup that conveys meaning, and it can be further acted upon by the user agent (e.g. with custom local style sheets). This tag is the exact opposite of {{kbd}}, which is for example input.

Usage[ویرایش]

The template takes one mandatory parameter, the content to be marked up. If this content contains "=" (an equals sign), the parameter must be explicitly named |1=, or the template will fail. (This is a limitation of the MediaWiki software, not the template.) It is always safer to use |1= syntax. It may be used as a container for {{var}}, {{varserif}} or <var>...</var> when the example output contains or consists entirely of a variable. It may also be used with (but not inside) {{code}}, or with <code>...</code> (it generally should not be used inside the latter, as output is not a part of source code, but something that results from it; however, this style can be used to illustrate computer display of mixed type, as illustrated below).

For cases where it is useful to display the color of the output, there is an optional parameter |color= that takes an رنگ‌های وب (in which case the # is mandatory). For accessibility reasons, color should never be the only distinguishing factor, as foo and foo may be indistinguisahble to color-blind readers.

There may also be cases where some other aspect of the output may need to be reproduced; the |style= parameter accepts any complete CSS statement(s), terminating with a semicolon, e.g. |style=font-variant:small-caps; font-style:italic;.

Examples:

  • {{samp|1=[A]bort, [R]etry, [F]ail?}}: "The error message [A]bort, [R]etry, [F]ail? has been cited as notoriously user-unfriendly."
  • {{samp|%}} with {{kbd|1=ssh hostname}}: "At the % prompt, the user must enter ssh hostname."
  • {{samp|Error|color=red}}, to indicate output color: On failure, the Error light activates.
  • {{samp|Error|color=red|style=font-variant:small-caps;}}, for more customization: On failure, the Error light activates.

See also[ویرایش]

Template Example output Use
{{strong}} strong semantic emphasis To indicate <strong> emphasis instead of (or as well as) simple typographical boldfacing.
{{strongbad}} "Never use..." Same as {{strong}} but in red.
{{stronggood}} "Only use..." Same as {{strong}} but in green.
{{em}} mild semantic emphasis As per {{strong}} but for the milder <em> emphasis (instead of / as well as typographical italicization).
{{var}} strIllustratePrefix To indicate text is a variable name. Use for any variables except those whose names include "I" (uppercase&nbsp;i) and/or "l" (lowercase&nbsp;L), where {{varserif}} below should be used instead to ensure a distinction between these letters is noticeable.
{{varserif}} strIllustratePrefix (see {{var}} above).
{{wikivar}}
purge rev-ID : -   b: c: m: n: q: s: t: w: wikt: ?version all messages
$wgMagicWordsEn at CVS Language.php   meta:help:Variable, meta:Global variables
method a method b generates
common namespaces [-2 - 15] / used at all MediaWiki projects
{{ns:-2}} {{ns:Media}}  مدیا
{{ns:-1}} {{ns:Special}}  ویژه
(Main) – MediaWiki:Blanknamespace – ‏(مقاله)
{{ns:1}} {{ns:Talk}}  بحث
{{ns:2}} {{ns:User}}  کاربر
{{ns:3}} {{ns:User_talk}}  بحث کاربر
{{ns:4}} {{ns:Project}}  ویکی‌پدیا
{{ns:5}} {{ns:Project_talk}}  بحث ویکی‌پدیا
{{ns:6}} {{ns:Image}}  پرونده
{{ns:7}} {{ns:Image_talk}}  بحث پرونده
{{ns:8}} {{ns:MediaWiki}}  مدیاویکی
{{ns:9}} {{ns:MediaWiki_talk}}  بحث مدیاویکی
{{ns:10}} {{ns:Template}}  الگو
{{ns:11}} {{ns:Template_talk}}  بحث الگو
{{ns:12}} {{ns:Help}}  راهنما
{{ns:13}} {{ns:Help_talk}}  بحث راهنما
{{ns:14}} {{ns:Category}}  رده
{{ns:15}} {{ns:Category_talk}}  بحث رده
reserved namespaces
{{ns:16}}    
{{ns:17}}    
{{ns:98}}    
{{ns:99}}    
custom namespaces
{{ns:100}}    درگاه
{{ns:101}}    بحث درگاه
{{ns:102}}    
{{ns:103}}    
{{ns:104}}    
{{ns:105}}    
{{ns:106}}    
{{ns:107}}    
{{ns:121}}    
{{ns:122}}    
{{ns:127}}    
{{ns:128}}    
{{ns:2147483646}}    
{{ns:2147483647}}    
variables
{{CURRENTDAY}}  ۶
{{CURRENTDAY2}}  ۰۶
{{CURRENTDAYNAME}}  دوشنبه
{{CURRENTDOW}}  ۱
{{CURRENTMONTH}}  ۰۵
{{CURRENTMONTHABBREV}}  مه
{{CURRENTMONTHNAME}}  مه
{{CURRENTMONTHNAMEGEN}}  مهٔ
{{CURRENTTIME}}  ‏۰۲:۱۴
{{CURRENTWEEK}}  ۱۹
{{CURRENTYEAR}}  ۲۰۲۴
{{FULLPAGENAME}}  الگو:Samp
{{FULLPAGENAMEE}}  %D8%A7%D9%84%DA%AF%D9%88:Samp 1
{{NAMESPACE}}  الگو
{{NAMESPACEE}}  %D8%A7%D9%84%DA%AF%D9%88 1
{{NUMBEROFARTICLES}}  ۱٬۰۰۱٬۴۲۲
{{NUMBEROFFILES}}  ۹۰٬۵۰۴
{{PAGENAME}}  Samp
{{PAGENAMEE}}  Samp 1
{{SCRIPTPATH}}  /w 1
{{SERVER}}  //fa.wikipedia.org
{{SERVERNAME}}  fa.wikipedia.org
{{SITENAME}}  ویکی‌پدیا
predefined templates
{{FULLURL:}}  
{{FULLURLE:}}  
{{GRAMMAR:}}  GRAMMAR CVS /languages/
{{INT:}}  
{{LC:}}  
{{LCFIRST:}}  
{{LOCALURL:}}  
{{LOCALURLE:}}  
{{MSG:}}  
{{MSGNW:}}  
{{NS:}}  
{{PLURAL:}}  
{{REVISIONID:}}  
{{REVISIONID}}  -
{{SUBST:}}  
{{UC:}}  
{{UCFIRST:}}  
1 this documentation displays this value LTR (left to right)
 | common reserved custom namespacesvariablespredefined templates
  
purge rev-ID : -   b: c: m: n: q: s: t: w: wikt: ?version all messages
$wgMagicWordsEn at CVS Language.php   meta:help:Variable, meta:Global variables
method a method b generates
common namespaces [-2 - 15] / used at all MediaWiki projects
{{ns:-2}} {{ns:Media}}  مدیا
{{ns:-1}} {{ns:Special}}  ویژه
(Main) – MediaWiki:Blanknamespace – ‏(مقاله)
{{ns:1}} {{ns:Talk}}  بحث
{{ns:2}} {{ns:User}}  کاربر
{{ns:3}} {{ns:User_talk}}  بحث کاربر
{{ns:4}} {{ns:Project}}  ویکی‌پدیا
{{ns:5}} {{ns:Project_talk}}  بحث ویکی‌پدیا
{{ns:6}} {{ns:Image}}  پرونده
{{ns:7}} {{ns:Image_talk}}  بحث پرونده
{{ns:8}} {{ns:MediaWiki}}  مدیاویکی
{{ns:9}} {{ns:MediaWiki_talk}}  بحث مدیاویکی
{{ns:10}} {{ns:Template}}  الگو
{{ns:11}} {{ns:Template_talk}}  بحث الگو
{{ns:12}} {{ns:Help}}  راهنما
{{ns:13}} {{ns:Help_talk}}  بحث راهنما
{{ns:14}} {{ns:Category}}  رده
{{ns:15}} {{ns:Category_talk}}  بحث رده
reserved namespaces
{{ns:16}}    
{{ns:17}}    
{{ns:98}}    
{{ns:99}}    
custom namespaces
{{ns:100}}    درگاه
{{ns:101}}    بحث درگاه
{{ns:102}}    
{{ns:103}}    
{{ns:104}}    
{{ns:105}}    
{{ns:106}}    
{{ns:107}}    
{{ns:121}}    
{{ns:122}}    
{{ns:127}}    
{{ns:128}}    
{{ns:2147483646}}    
{{ns:2147483647}}    
variables
{{CURRENTDAY}}  ۶
{{CURRENTDAY2}}  ۰۶
{{CURRENTDAYNAME}}  دوشنبه
{{CURRENTDOW}}  ۱
{{CURRENTMONTH}}  ۰۵
{{CURRENTMONTHABBREV}}  مه
{{CURRENTMONTHNAME}}  مه
{{CURRENTMONTHNAMEGEN}}  مهٔ
{{CURRENTTIME}}  ‏۰۲:۱۴
{{CURRENTWEEK}}  ۱۹
{{CURRENTYEAR}}  ۲۰۲۴
{{FULLPAGENAME}}  الگو:Samp
{{FULLPAGENAMEE}}  %D8%A7%D9%84%DA%AF%D9%88:Samp 1
{{NAMESPACE}}  الگو
{{NAMESPACEE}}  %D8%A7%D9%84%DA%AF%D9%88 1
{{NUMBEROFARTICLES}}  ۱٬۰۰۱٬۴۲۲
{{NUMBEROFFILES}}  ۹۰٬۵۰۴
{{PAGENAME}}  Samp
{{PAGENAMEE}}  Samp 1
{{SCRIPTPATH}}  /w 1
{{SERVER}}  //fa.wikipedia.org
{{SERVERNAME}}  fa.wikipedia.org
{{SITENAME}}  ویکی‌پدیا
predefined templates
{{FULLURL:}}  
{{FULLURLE:}}  
{{GRAMMAR:}}  GRAMMAR CVS /languages/
{{INT:}}  
{{LC:}}  
{{LCFIRST:}}  
{{LOCALURL:}}  
{{LOCALURLE:}}  
{{MSG:}}  
{{MSGNW:}}  
{{NS:}}  
{{PLURAL:}}  
{{REVISIONID:}}  
{{REVISIONID}}  -
{{SUBST:}}  
{{UC:}}  
{{UCFIRST:}}  
1 this documentation displays this value LTR (left to right)
 | common reserved custom namespacesvariablespredefined templates
To display wikicode variables and magic words as they would appear in code.
{{para}} |title=  |year=2008 To display template parameters with or without values.
{{param}} {{{title}}}  {{{title|alt}}}  etc. To display parameters as used in code (i.e. with triple braces), especially to indicate relationships between them. May be combined with {{para}} above.
{{tlx}} etc. {{Template|first parameter|...}} To display a template call (with or without parameters and values) as code.
{{tag}} "With HTML <img>...</img> tags..." To render عنصر اچ‌تی‌ام‌الs ("tags") as prose.
{{code}} "Always include the alt= parameter..." To indicate text is source code. To nest other templates within {{code}}, use <code>...</code>.
{{syntaxhighlight}} (or {{sxhl}})  Wrapper for <syntaxhighlight>...</syntaxhighlight>, but will wrap overflowing text.
{{deprecated code}} "Do not use <blink>...</blink>..." (or {{dc2}})&nbsp; To indicate deprecated source code in template documentation, articles on HTML specs, etc.
{{pre}} For larger blocks of source code and other pre-formatted text.
{{bq}} For indented blocks of content, such as block quotations, examples, poems, etc.
{{kbd}} user input To indicate user input.
{{key press}} CtrlX To indicate specific keystroke/s input.
{{pskeypress}} × To indicate PlayStation-style gamepad key presses.
{{samp}} example output To indicate sample or example output.