< Template:Param value(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Template:Tlr
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 Template:Pval 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: Template:Pvalue
{{pval|* #|border=thin dashed purple|bg=#ffe6e6|style=border-radius:5px|space=␠}}
yields: Template:Pval
Making spaces visible
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:
See also
Template:C |
---|
|
Template | Example output | Use |
---|
Template:Tlb | Important! | To indicate <strong> importance, seriousness, or urgency instead of just simple typographical boldfacing | Template:Tlb | "Never use ..." | Same as Template:Braces but in red | Template:Tlb | "Only use ..." | Same as Template:Braces but in green | Template:Tlb | "An emphatic phrase" | To indicate <em> stress emphasis (not just purely typographical italicization like for book titles or foreign terms) | Template:Tlb | 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, Template:Braces should be used to ensure a noticeable distinction | Template:Tlb | Template:Var serif | (see Template:Braces above) | Template:Tlb | {{DEFAULTSORT:Y, X}} | To display wikicode variables and magic words as they would appear in code | Template:Tlb | |year=2008 | To display template parameters with or without values | Template:Tlb | Template:Param | To display parameters as used in code (i.e. with triple braces), especially to indicate relationships between them. May be combined with Template:Braces above | Template:Tlb | Template:Tjp | To display template parameters with colors (as they would appear in the {{tj}} and {{tji}} templates) | Template:Tlb | Template:Pvalue | 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. | Template:Tlb etc. | {{Template|1|2|...|10}} | To display a template call (with or without parameters and values) as code | Template:Tlb | Page Template:Template journal inline/styles.css has no content.{{hatnoteLua error: expandTemplate: template "Template journal inline/arg" does not exist.}} | 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 | Template:Tlb | "The <img>...</img> tags ..." | To render HTML elements ("tags") in prose | Template:Tlb/Template:Tlb | "Ensure the alt= parameter ..." | To indicate text is source code. To nest other templates within Template:Braces, use <code>...</code> . {{codett}} differs only in styling: someMethod becomes Template:Codett | Template:Tlb | "FORTH has keyword Template:PreCode." | Like Template:Tlb, 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> | Template:Tlb | [this is a block template] | (Template:Thin space) Wrapper for <syntaxhighlight>...</syntaxhighlight> , but will wrap overflowing text | Template:Tlb | "Do not use <blink> ." | (Template:Thin space) To indicate deprecated source code in template documentation, articles on HTML specs, etc. The {{dc2}} variant uses strike-through (<blink> ) while {{dcr}} uses red (<Template:Dcr> ). | Template:Tlb | [this is a block template] | For larger blocks of source code and other pre-formatted text | Template:Tlb | [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 | Template:Tlb | [this is a block template] | For block quotations (only – never for non-quotations) | Template:Tlb | [this is a block template] | For indented blocks of material; visually identical to {{quote}} but without quote markup | Template:Tlb | user input | To indicate user input | Template:Tlb | Ctrl+x | To indicate specific-keystroke input, including combinations | Template:Tlb | Template:Key top | Similar; includes more symbols, but does not directly support combinations | Template:Tlb | Don't save | To indicate a button in a user interface | Template:Tlb | example output | To indicate sample or example output |
|
|