Zeroclanzhang(讨论 | 贡献)2024年1月16日 (二) 10:40的版本 (创建页面,内容为“{{Documentation subpage}} {{High-use}} {{tlr|clear=right|pvalue|pval}} Provides a lightly bordered box to highlight param values on Template documentation pages. Especially useful in cases where values may have leading or trailing blanks, or multiple embedded blanks. == Usage == {{tlc|param value|''value''}} == Parameters == There is one required positional parameter for the value, and four optional params: three for sty…”)
This template is used on approximately 137,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 own user subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them.
Provides a lightly bordered box to highlight param values on Template 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 any CSS style attributes, with one or more semicolon-separated attribute: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
You may make space 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 between one and two:
Space symbol – (U+2420 = ␠ ) : {{param value|one two|space=␠}} ⟶ one␠␠two
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
To display parameters as used in code (i.e. with triple braces), especially to indicate relationships between them. May be combined with {{para}} above
To display parameter values lightly bordered; replaces <code>...</code>, especially when value contains embedded or leading/trailing blanks; visualized here with middot (·) but can use ␠, ▯, or any character.
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
To indicate text is source code. To nest other templates within {{code}}, use code>>...</code>. {{codett}} differs only in styling: someMethod becomes someMethod
( or {{dc}}) To indicate deprecated source code in template documentation, articles on HTML specs, etc. The {{dc2}} variant uses strike-through (blink>>) while {{dcr}} uses red (blink>>).
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