Template:Poem/doc: Difference between revisions

From Rhythm Heaven Wiki
Jump to navigation Jump to search
(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...")
 
m (typo)
 
(One intermediate revision by the same user not shown)
Line 68: Line 68:
}}
}}
there
there
| Using the named argument format <code>&#124;1=</code> strips the leading and trailing whitespaces within the content.
| The named argument format <code>&#124;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 Paradise
GBA={{Nihongo|Rhythm Tengoku}}
Wii=Beat the Beat: Rhythm Paradise
:DS={{Nihongo|Rhythm Tengoku Gold}}
3DS=Rhythm Paradise Megamix
::Wii={{Nihongo|Minna no Rhythm Tengoku}}
Switch=Rhythm Paradise Groove
:::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 Paradise
GBA={{Nihongo|Rhythm Tengoku}}
Wii=Beat the Beat: Rhythm Paradise
:DS={{Nihongo|Rhythm Tengoku Gold}}
3DS=Rhythm Paradise Megamix
::Wii={{Nihongo|Minna no Rhythm Tengoku}}
Switch=Rhythm Paradise Groove
:::3DS={{Nihongo|Rhythm Tengoku: The Best+}}
::::Switch={{Nihongo|Rhythm Tengoku: Miracle Stars}}
}}
}}
| Using the named argument format completely rids you of worries about equal signs.
|
|-
The named argument format completely rids you of worries about equal signs.
| <pre style="white-space:pre">
 
{{Poem|1=
As a mimic of Extension:Poem, each colon at the start of a line is transformed to a 1em-wide inline margin.
GBA=Rhythm Tengoku
:DS=Rhythm Tengoku Gold
::Wii=Minna no Rhythm Tengoku
:::3DS=Rhythm Tengoku: The Best+
::::Switch=Rhythm Tengoku: Miracle Stars
}}
</pre>
| style="white-space:nowrap" | {{Poem|1=
GBA=Rhythm Tengoku
:DS=Rhythm Tengoku Gold
::Wii=Minna no Rhythm Tengoku
:::3DS=Rhythm Tengoku: The Best+
::::Switch=Rhythm Tengoku: Miracle Stars
}}
| Each colon at the start of a line adds 1em-wide inline margin to that line.
|}
|}
<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
HIJKLMN
OPQ RST
UVW XYZ

there

Hello
{{Poem|

ABCDEFG
HIJKLMN
OPQ RST
UVW XYZ

}}
there
Hello



ABCDEFG
HIJKLMN
OPQ RST
UVW XYZ

there

Newlines before the content are reserved. Those after are not.
Hello
{{Poem|1=

ABCDEFG
HIJKLMN
OPQ RST
UVW XYZ
}}
there
Hello

ABCDEFG
HIJKLMN
OPQ RST
UVW XYZ

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 = with {{=}} helps, but things will become annoying when there are too many of them.

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
DS=Rhythm Tengoku Gold
Wii=Minna no Rhythm Tengoku
3DS=Rhythm Tengoku: The Best+
Switch=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.