Template:Poem/doc: Difference between revisions
HyperNervie (talk | contribs) (Created page with "This template serves as an alternative for Extension:Poem before that extension is enabled on this wiki. Pass the content of poem to {{param|1}} and it will act like <code><nowiki><poem>{{{1}}}</poem></nowiki></code>. Adding classes, styles and a "compact" attribute to the poem block is not supported by this template. {|class="wikitable" ! Input !! Output !! Explanation |- | <pre style="white-space:pre"> Hello {{Poem|ABCDEFG HIJ...") |
HyperNervie (talk | contribs) m (typo) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 68: | Line 68: | ||
}} | }} | ||
there | there | ||
| | | The named argument format <code>|1=</code> strips the leading and trailing whitespaces within the content. | ||
|- | |- | ||
| <pre style="white-space:pre"> | | <pre style="white-space:pre"> | ||
| Line 90: | Line 90: | ||
| <pre style="white-space:pre"> | | <pre style="white-space:pre"> | ||
{{Poem | {{Poem | ||
|DS{{=}}Rhythm Heaven | |DS{{=}}''[[Rhythm Heaven]]'' | ||
Wii{{=}}Rhythm Heaven Fever | Wii{{=}}''[[Rhythm Heaven Fever]]'' | ||
3DS{{=}}Rhythm Heaven Megamix | 3DS{{=}}''[[Rhythm Heaven Megamix]]'' | ||
Switch{{=}}Rhythm Heaven Groove | Switch{{=}}''[[Rhythm Heaven Groove]]'' | ||
}} | }} | ||
</pre> | </pre> | ||
| style="white-space:nowrap" | {{Poem | | style="white-space:nowrap" | {{Poem | ||
|DS{{=}}Rhythm Heaven | |DS{{=}}''[[Rhythm Heaven]]'' | ||
Wii{{=}}Rhythm Heaven Fever | Wii{{=}}''[[Rhythm Heaven Fever]]'' | ||
3DS{{=}}Rhythm Heaven Megamix | 3DS{{=}}''[[Rhythm Heaven Megamix]]'' | ||
Switch{{=}}Rhythm Heaven Groove | Switch{{=}}''[[Rhythm Heaven Groove]]'' | ||
}} | }} | ||
| Replacing all <code>=</code> with <code>{{((}}={{))}}</code> helps, but things will become annoying when there are too many of them. | | | ||
Replacing all <code>=</code> with <code>{{((}}={{))}}</code> helps, but things will become annoying when there are too many of them. | |||
By the way, wiki markups can be included in the content. | |||
|- | |- | ||
| <pre style="white-space:pre"> | | <pre style="white-space:pre"> | ||
{{Poem|1= | {{Poem|1= | ||
DS=Rhythm | GBA={{Nihongo|Rhythm Tengoku}} | ||
Wii= | :DS={{Nihongo|Rhythm Tengoku Gold}} | ||
3DS=Rhythm | ::Wii={{Nihongo|Minna no Rhythm Tengoku}} | ||
Switch=Rhythm | :::3DS={{Nihongo|Rhythm Tengoku: The Best+}} | ||
::::Switch={{Nihongo|Rhythm Tengoku: Miracle Stars}} | |||
}} | }} | ||
</pre> | </pre> | ||
| style="white-space:nowrap" | {{Poem|1= | | style="white-space:nowrap" | {{Poem|1= | ||
DS=Rhythm | GBA={{Nihongo|Rhythm Tengoku}} | ||
Wii= | :DS={{Nihongo|Rhythm Tengoku Gold}} | ||
3DS=Rhythm | ::Wii={{Nihongo|Minna no Rhythm Tengoku}} | ||
Switch=Rhythm | :::3DS={{Nihongo|Rhythm Tengoku: The Best+}} | ||
::::Switch={{Nihongo|Rhythm Tengoku: Miracle Stars}} | |||
}} | }} | ||
| | | | ||
The named argument format completely rids you of worries about equal signs. | |||
As a mimic of Extension:Poem, each colon at the start of a line is transformed to a 1em-wide inline margin. | |||
|} | |} | ||
<includeonly>[[Category:Templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude> | <includeonly>[[Category:Templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude> | ||
Latest revision as of 07:17, 5 September 2025
This template serves as an alternative for Extension:Poem before that extension is enabled on this wiki.
Pass the content of poem to {{{1}}} and it will act like <poem>{{{1}}}</poem>. Adding classes, styles and a "compact" attribute to the poem block is not supported by this template.
| Input | Output | Explanation |
|---|---|---|
Hello
{{Poem|ABCDEFG
HIJKLMN
OPQ RST
UVW XYZ
}}
there
|
Hello
ABCDEFG there |
|
Hello
{{Poem|
ABCDEFG
HIJKLMN
OPQ RST
UVW XYZ
}}
there
|
Hello
there |
Newlines before the content are reserved. Those after are not. |
Hello
{{Poem|1=
ABCDEFG
HIJKLMN
OPQ RST
UVW XYZ
}}
there
|
Hello
ABCDEFG there |
The named argument format |1= strips the leading and trailing whitespaces within the content.
|
{{Poem
|GBA=Rhythm Tengoku
DS=Rhythm Tengoku Gold
Wii=Minna no Rhythm Tengoku
3DS=Rhythm Tengoku: The Best+
Switch=Rhythm Tengoku: Miracle Stars
}}
|
Oops! The parser thought the template was given an argument named {{{GBA}}} and found nothing for {{{1}}}...
| |
{{Poem
|DS{{=}}''[[Rhythm Heaven]]''
Wii{{=}}''[[Rhythm Heaven Fever]]''
3DS{{=}}''[[Rhythm Heaven Megamix]]''
Switch{{=}}''[[Rhythm Heaven Groove]]''
}}
|
Replacing all By the way, wiki markups can be included in the content. | |
{{Poem|1=
GBA={{Nihongo|Rhythm Tengoku}}
:DS={{Nihongo|Rhythm Tengoku Gold}}
::Wii={{Nihongo|Minna no Rhythm Tengoku}}
:::3DS={{Nihongo|Rhythm Tengoku: The Best+}}
::::Switch={{Nihongo|Rhythm Tengoku: Miracle Stars}}
}}
|
GBA=Rhythm Tengoku |
The named argument format completely rids you of worries about equal signs. As a mimic of Extension:Poem, each colon at the start of a line is transformed to a 1em-wide inline margin. |