Difference between revisions of "Template:Example"

From EVE University Wiki
Jump to: navigation, search
m (Oops - no it isn't! :))
m (Change the default width to 95%.)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div style="background-color:#161626; border: 1px solid #6666a8; padding:0.8em; text-align:left; color:#ffffff; overflow:hidden; font-size:90%;">{{{1|An example!}}}</div><noinclude>
+
{{Color box
== Documentation ==
+
|border= #6666a8
As the name suggests, this template produces a colored box, which is used when you want to give an example on a page. You can use common wiki-formatting (eg bold, links) if you wish. The formatting of this template is kept subtle on purpose, so as not to interfere too much with the general flow of a page (if you want a stronger emphasis for your text, you can use <code>{{t|note box}}</code> or even <code>{{t|important note box}}</code>).
+
|width= {{{width|95%}}}
 
+
|color= #161626
If the text you would like to use include an equals sign (=), you need to explicitly declare your text as a numbered parameter (i.e. put <code>1=</code> before your example text), otherwise the template will display nothing.
+
|align= left
 
+
|text= white
=== Examples ===
+
|italics= no
 
+
|{{{1|An example!}}}
<code><nowiki>{{example|An example to ''illustrate'' my article with a link to the [[Venture]].}}</nowiki></code> gives:
+
}}<noinclude>
{{example|An example to ''illustrate'' my article with a link to the [[Venture]].}}
+
{{documentation}}
 
+
</noinclude>
<code><nowiki>{{example|How not to put the formula 2+2=4 into an example.}}</nowiki></code> gives:
 
{{example|How not to put the formula 2+2=4 into an example.}}
 
 
 
<code><nowiki>{{example|1=How to put the formula 2+2=4 into an example.}}</nowiki></code> gives:
 
{{example|1=How to put the formula 2+2=4 into an example.}}
 
 
 
== See also ==
 
*<code>{{t|note box}}</code> and <code>{{t|important note box}}</code>, designed for general notes and warnings on pages.
 
*<code>{{t|color box}}</code>, the general template for creating coloured boxes with text in them.
 
 
 
[[Category:Template]]</noinclude>
 

Latest revision as of 13:51, 5 February 2024

An example!
Template documentation (for the above template, sometimes hidden or invisible)
Description
As the name suggests, this template produces a colored box, which is used when you want to give an example on a page. You can use common wiki-formatting (e.g. bold, links) if you wish. The formatting of this template is kept subtle on purpose, so as not to interfere too much with the general flow of a page (if you want a stronger emphasis for your text, you can use {{Note box}} or even {{Important note box}}).
Dependencies
Uses
{{Color box}}
Syntax
{{Example|<content>|<width= width>}}
Parameters
content 
The note text inside the box. All wiki-formatting (bold, text color, links, etc) work as normal. If the text you would like to use include an equals sign (=), you need to explicitly declare your text as a numbered parameter (i.e. put 1= before your text), otherwise the template will display nothing.
width 
Sets the width of the box. It's recommended to set this as a percentage (of the paragraph width), so 50% will produce a text box half as wide as the surrounding paragraph. If omitted, the text box will be as wide as the surrounding paragraph. When width is set to less than 100%, the box will be centered.
Examples
{{Example|An example to ''illustrate'' my article with a link to the [[Venture]].}}
gives ...
An example to illustrate my article with a link to the Venture.


{{Example|How not to put the formula 2+2=4 into an example.}}
gives ...
An example!


{{Example|1= How to put the formula 2+2=4 into an example.}}
gives ...
How to put the formula 2+2=4 into an example.


See also
Visit Template:Example/doc to edit this text! (How does this work?) (Refresh this text - why?)