Difference between revisions of "Template:Highlighted"
m (more lost pipes) |
m (typos) |
||
Line 1: | Line 1: | ||
− | <includeonly>{{#if:{{{内容|{{{content|}}}}}}|<span style="{{#if:{{{背景颜色|{{{background-color|}}}}}}|background-color:{{{背景颜色|{{{background-color}}}}}};}}{{#if:{{{内容颜色|{{{content-color|}}}}}}|color:{{{内容颜色|{{{content-color}}}}}};}}" title="{{{内容提示|{{{title|}}}}}}" {{{其他内容控制符|{{{attributes|}}}}}}>{{{内容|{{{content}}}}}}</span><sup {{#ifeq:{{{注释文字|{{{isref|}}}}}}|yes|class="mobileref"}} style="{{#if:{{{上标背景色|{{{sup-background-color|}}}}}}|background-color:{{{上标背景色|{{{sup-background-color}}}}}};}}{{#if:{{{上标文字色|{{{sup-color|}}}}}}|color:{{{上标文字色|{{{sup-color}}}}}};}}" title="{{{上标提示|{{{sup-title|}}}}}}" {{{其他上标文字控制符|{{{sup-attributes} | + | <includeonly>{{#if:{{{内容|{{{content|}}}}}}|<span style="{{#if:{{{背景颜色|{{{background-color|}}}}}}|background-color:{{{背景颜色|{{{background-color}}}}}};}}{{#if:{{{内容颜色|{{{content-color|}}}}}}|color:{{{内容颜色|{{{content-color}}}}}};}}" title="{{{内容提示|{{{title|}}}}}}" {{{其他内容控制符|{{{attributes|}}}}}}>{{{内容|{{{content}}}}}}</span><sup {{#ifeq:{{{注释文字|{{{isref|}}}}}}|yes|class="mobileref"}} style="{{#if:{{{上标背景色|{{{sup-background-color|}}}}}}|background-color:{{{上标背景色|{{{sup-background-color}}}}}};}}{{#if:{{{上标文字色|{{{sup-color|}}}}}}|color:{{{上标文字色|{{{sup-color}}}}}};}}" title="{{{上标提示|{{{sup-title|}}}}}}" {{{其他上标文字控制符|{{{sup-attributes}}}}}}}>{{{上标文字|{{{sup|}}}}}}</sup>|{{color|red|(Incorrect usage of [[:Template:Highlighted]]. Refer to aforementioned documentation.)}}}}</includeonly><noinclude> |
{{doc}} | {{doc}} | ||
</noinclude> | </noinclude> |
Revision as of 20:36, 27 August 2019
This is a template for highlighting text. It is packaged to create Template:NeedsTranslating, Template:fact, etc.
Syntax and Usage
Source code: {{highlighted|content=this is the content|background-color=red|content-color=yellow|title=This is the content title text|sup=this is the superscript|sup-color=blue|sup-background-color=#FBFE76|sup-title=this is the superscript title text|attributes=class="noprint"|sup-attributes=class="noprint Template-Fact"}}
Displayed as:
this is the superscriptSource code: {{Highlighted|content=this is the content|content-color=blue}}
Displayed as: this is the content
Explanation
content
is the only required argument. You may omit any of the other arguments.- Ignore
sup
and related arguments if superscripts are not needed. - If the argument contains two right braces (
}}
), you must escape it with<nowiki>
tages, i.e.<nowiki>}}</nowiki>
. - If the argument contains pipe sign (
|
), use{{!}}
to escape it. - Arguments may contain pairs of double square brackets (for internal links), but it may not contain double right square brackets and then double left square brackets, i.e.
]][[
.