Template:Examples

From Zelda Wiki, the Zelda encyclopedia
Jump to navigation Jump to search


Purpose

This template is for generating examples in Category:Template documentation.

Usage

Basic SyntaxAll Parametrs
{{Examples
 |<nowiki>example-1</nowiki>
 |<nowiki>example-2</nowiki>
 |...
 |<nowiki>example-n</nowiki>
}}
  • example-nRequired — Whatever syntax you're trying to demonstrate (probably a template call). It needs to be wrapped in <nowiki> tags.
{{Examples
 |caption= 
 |wrapLines= true
 |vertical= true
 |showNumbers= false
 |<nowiki>example-1</nowiki>
 |<nowiki>example-2</nowiki>
 |...
 |<nowiki>example-n</nowiki>
}}
  • [caption]Optional — Adds a caption to the the table of examples. Use this if you call the template multiple times on the same page. See Template:Cite Book/Documentation for example.
  • [vertical]Optional — When enabled, examples are listed separately instead of them all being in one table. This display is more suitable for some examples with wider input/output.
  • [wrapLines]Optional — Enables word wrapping for input shown in <pre> tags. Use this when the input lines are too long for the width of the screen. Otherwise, leave word wrapping off so that readers can see where the actual newlines are supposed to go in the template input.
  • showNumbers — If set to false the link to the example number is suppressed.
  • example-nRequired — Whatever syntax you're trying to demonstrate (probably a template call). It needs to be wrapped in <nowiki> tags.

Examples

Inline input
Input
{{Examples
 |<nowiki>{{Term|Series|Crisp Tomato|link}}</nowiki>
 |<nowiki>{{Color TWWHD|Vermilion|merchant's oath}}</nowiki>
 |<nowiki>{{Icon|LADX|Bananas}}</nowiki>
}}
Output
#InputOutput
1{{Term|Series|Crisp Tomato|link}} Crisp Tomato
2{{Color TWWHD|Vermilion|merchant's oath}} merchant's oath
3{{Icon|LADX Bananas}} Bananas
With header rows for descriptions
Input
{{Examples
 |- {{TP|-}}
 |<nowiki>{{Icon|TP A}}</nowiki>
 |<nowiki>{{Icon|TP B}}</nowiki>
 |- {{TPHD|-}}
 |<nowiki>{{Icon|TPHD A}}</nowiki>
 |<nowiki>{{Icon|TPHD B}}</nowiki>
}}
Output
#InputOutput
Twilight Princess
4{{Icon|TP A}} A Button
5{{Icon|TP B}} B Button
Twilight Princess HD
6{{Icon|TPHD A}} A Button
7{{Icon|TPHD B}} B Button
Block input (respects newlines)
Input
{{Examples
|<nowiki>{{Tabs|align=center
 |tab1= Foo Tab
 |content1= Foo
 |tab2= Bar Tab
 |content 2 = Bar}}</nowiki>
}}
Output
#InputOutput
8
{{Tabs|align=center
 |tab1= Foo Tab
 |content1= Foo
 |tab2= Bar Tab
 |content2 = Bar
}}
Foo TabBar Tab
Foo
Bar
Block input with wrapLines enabled
Input
{{Examples
|wrapLines= true
|<nowiki>{{Midna
 |quote1= Sometimes templates (namely ones that quote game dialogue) can have input lines that are long like this: bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
 |context1= If wrapLines wasn't enabled here, the above would all be forced onto one line and it would take a really wide screen to see it properly. For shorter input, disabling line wrapping is good because it shows you where the newlines should actually go when using the template.
}}</nowiki>
Output
#InputOutput
9
{{Midna
 |quote1= Sometimes templates (namely ones that quote game dialogue) can have input lines that are long like this: bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
 |context1= If wrapLines wasn't enabled here, the above would all be forced onto one line and it would take a really wide screen to see it properly. For shorter input, disabling line wrapping is good because it shows you where the newlines should actually go when using the template.
}}
Midna's Commenthide ▲
If wrapLines wasn't enabled here, the above would all be forced onto one line and it would take a really wide screen to see it properly. For shorter input, disabling line wrapping is good because it shows you where the newlines should actually go when using the template.
Midna says:

Sometimes templates (namely ones that quote game dialogue) can have input lines that are long like this: bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla

Vertical format
Input
{{Examples
 |vertical= true
 |<nowiki>{{Transcript Copy|fromPage= Aryll|storedAs= Letter|withFormatting= true}}</nowiki>
 |<nowiki>{{Transcript Copy|fromPage= Baito|storedAs= Letter|withFormatting= true}}</nowiki>
}}
Output
Input
{{Transcript Copy|fromPage= Aryll|storedAs= Letter|withFormatting= true}}
Output

How have you been, Big Brother?
 I'm here on the pirate ship writing you
 this letter. Isn't that neat?

 At first, I was really scared, but they're
 all actually nice...for pirates, I mean.


 Mr. Gonzo is a really big guy, but ever
 since Miss Tetra left, he's been crying
 like a baby. It's kinda funny...but sort
 of sad, too.
 Nudge is a little strange, but nice, too,
 and as for Senza...his beard makes him
 look pretty mean, but he tells really cool
 stories when he gets in the right mood.
 Zuko's kind of weird, and Mako is pretty
 quiet... Mako immediately gets mad
 whenever I try to take his glasses...so I
 do that a lot. Hee hee!
 As usual, Niko is always fooling around.
 He won't take anything serious. Actually,
 he seems sad not to have you around
 anymore. Were you guys good friends?
 I helped them all out with their chores,
 and they actually paid me a little for it,
 so I'm sending the money to you. Please
 use it, Big Brother!
 I'll loan you my telescope for a little
 longer...but you have to return it to me
 eventually, OK?

 I'm doing fine here, so don't you worry.
 I'll take care of myself, so you be sure to
 take good care of yourself. Good luck!
                                      Aryll


Input
{{Transcript Copy|fromPage= Baito|storedAs= Letter|withFormatting= true}}
Output

Yo! How ya been, man? I gotta tell ya,
 you really helped me out back there at
 the Mail Center. I appreciate it!

 I've been trying real hard ever since then,
 but my postman skills are still weak.
 I just can't seem to hit 22 letters!
 I doubt I'll ever be as good as you, man.
 So anyway, I've been hearing all kinds of
 crazy tales about you, and I figured I
 just had to write you a letter.

 It sounds like you're doing some pretty
 amazing stuff, man! You're great!
 You're awesome! You're...the man, man!

 You can probably tell that I had no idea
 what to write, but hey, I figured the
 least I could do would be to send you
 a letter of encouragement.
 So... Yay, man, yay!
 Go, man, go! Go! Go!
 Never give up! Never lose hope!

 And while I don't make much, I'm sending
 you the wages I've earned lately. Just
 doing my part! Hope it helps!

 I'm really sorry I had to send this C.O.D.,
 but I guess that's the price of fame!
           Take care!
    Thanks again, boss! From Baito

The above documentation is transcluded from Template:Examples/Documentation. (edit | history)