Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Template:Param value

Permanently protected template
From Wikipedia, the free encyclopedia

value

Template documentation[view] [edit] [history] [purge]
Not to be confused withTemplate:Template parameter value.
WarningThis template is used onapproximately 146,000 pages.
To avoid major disruption and server load, any changes should be tested in the template's/sandbox or/testcases subpages, or in your ownuser subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on thetalk page before implementing them.

Provides a lightly bordered box to highlight param values onTemplate documentation pages. Especially useful in cases where values may have leading or trailing blanks, or multiple embedded blanks.

Usage

{{param value|value}}

Parameters

There is one required positional parameter for the value, and four optional params: three for styling the display, and one replacement parameter for dealing with how to render a blank space:

|1= – the value to be highlighted; required (no default)
|border= – may be used to set border attributes. default:thin solid #caa. Alias:|b=.
|bg-color= – may be used to set background-color. default:white. Alias:|bg=.
|style= – may be used to set anyCSS style attributes, with one or more semicolon-separatedattribute:value pairs. default:none.
|space= – may be used to make spaces visible. Alias:|sp=. See#Making spaces visible below.

Note on special characters: if the value to be highlighted contains an equal sign, it must be escaped: use{{=}} instead of a bare equal sign character.

Examples

  • {{param value|2blanks between}} yields:2blanks  between
  • {{param value|2blanks between|space=·}} yields:2blanks··between
  • {{param value| * : # }} yields:  * : # 
  • {{param value| * : # |border=2px dashed khaki}} yields:  * : # 
  • {{param value|white|bg=yellow}} yields:white
  • {{pvalue|thin solid #caa|bg=#f5fcf9}} yields:thin solid #caa
  • {{pval|* #|border=thin dashed purple|bg=#ffe6e6|style=border-radius:5px|space=␠}} yields:*␠␠#

Making spaces visible

You may makespace characters visible by replacing them with any character you choose using param|space=. Here are some characters that have been historically used for this purpose. In these examples, there are two spaces betweenone andtwo:

  • Space symbol – (U+2420 = ␠ ) :{{param value|one two|space=␠}}one␠␠two
  • Blank symbol – (U+2422 = ␢ ) :{{pvalue|one two|space=␢}}one␢␢two
    • Blank symbol – (smaller:) :{{pvalue|one two|space=<small>␢</small>}}onetwo
  • Middot – (U+00B7 = · ) :{{pval|one two|space=·}}one··two
  • Underbracket – (U+23B5 = ⎵ ) :{{pval|one two|space=⎵}}one⎵⎵two
  • White rectangle – (U+25AF = ▯ ) :{{pval|one two|space=▯}}one▯▯two
  • Undertie – (U+203F = ‿ ) :{{pval|one two|space=‿}}one‿‿two

See also

  • {{mono}}, monospaced font only
  • {{code}}, which only provides syntax higlighting, without forbidding line breaks
  • {{Codett}}, wrapper for this template that removes background and border styling
  • {{PreCode}}, which forbids line breaks inside the code
  • {{Syntaxhighlight}}
  • {{kbd}}, for keyboard input
Template  Example output  Use 
{{strong}}Important! To indicate<strong> importance, seriousness, or urgency instead of just simple typographical boldfacing
{{strongbad}} "Never use ..." Same as {{strong}} but in red
{{stronggood}} "Only use ..." Same as {{strong}} but in green
{{em}} "Anemphatic phrase" To indicate<em> stress emphasis (not just purely typographical italicization like for book titles or foreign terms)
{{var}}strPrefix To indicate text is a variable name. Use for any variable names except those including "I" (uppercase i) and/or "l" (lowercase L); for these, {{var serif}} should be used to ensure a noticeable distinction
{{var serif}}strIllustratePrefix (see {{var}} above)
{{tld}}{{DEFAULTSORT:Y, X}} To display wikicode variables andmagic words as they would appear in code
{{para}}|year=2008 To display template parameters with or without values
{{param}}{{{title|alt}}} To display parameters as used in code (i.e. with triple braces), especially to indicate relationships between them. May be combined with {{para}} above
{{tjp}}|selfref=yes To display template parameters with colors (as they would appear in the{{tj}} and{{tji}} templates)
{{param value}}··2·blanks·fore·and·aft·· To display parameter values lightly bordered; replaces <code>...</code>, especially when value contains embedded or leading/trailing blanks; visualized here withmiddot (·) but can use ␠, ▯, or any character.
{{tlx}} etc.{{Template|1|2|...|10}} To display a template call (with or without parameters and values) as code
{{tji}}{{hatnote|Hello|selfref=yes|category=no}} To showcase with colors in horizontal format the syntax of any template, while providing an easy way to display placeholder texts using colons as separators
{{tag}}"The<img>...</img> tags ..." To renderHTML elements ("tags") in prose
{{code}}/{{codett}}"Ensure thealt= parameter ..." To indicate text is source code. To nest other templates within {{code}}, use<code>...</code>.{{codett}} differs only in styling:someMethod becomessomeMethod
{{PreCode}}"FORTH has keyword?BRANCH." Like {{code}}, but prevents line breaks inside the code. Only for very short code parts.
{{subst:codenowiki}}{{small|small text example}} To wrap example code in<code><nowiki>...</nowiki></code>
{{subst:kbdnowiki}}{{large|large text example}} To wrap example code in<kbd><nowiki>...</nowiki></kbd>
{{syntaxhighlight}}    [this is a block template] ( or{{sxhl}})  Wrapper for<syntaxhighlight>...</syntaxhighlight>, but will wrap overflowing text
{{deprecated code}} "Do not use<blink>." ( or{{dc}})  To indicatedeprecated source code in template documentation, articles on HTML specs, etc. The{{dc2}} variant uses strike-through (<blink>) while{{dcr}} uses red (<blink>).
{{pre}}    [this is a block template] For larger blocks of source code and other pre-formatted text
{{tj}}    [this is a block template] To showcase with colors and multiple lines (vertical format) the syntax of any template, while providing an easy way to display placeholder texts using colons as separators
{{quote}}    [this is a block template] For block quotations (only – never for non-quotations)
{{block indent}}    [this is a block template] For indented blocks of material; visually identical to{{quote}} but without quote markup
{{kbd}}user input To indicate user input
{{key press}}Ctrl+x To indicate specific-keystroke input, including combinations
{{key top}}Left shift Similar; includes more symbols, but does not directly support combinations
{{button}}Don't save To indicate a button in a user interface
{{samp}}example output To indicate sample or example output
The abovedocumentation istranscluded fromTemplate:Param value/doc.(edit |history)
Editors can experiment in this template'ssandbox(edit |diff) andtestcases(edit) pages.
Add categories to the/doc subpage.Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Param_value&oldid=1227062142"
Categories:
Hidden category:

[8]ページ先頭

©2009-2025 Movatter.jp