Extension:Poem/ja

The Poem extension allows easy formatting of poems and similar material within. Once the extension is enabled, you can put any block of text within  tags, which has the following effects:


 * All newlines are preserved by converting them into tags
 * The block of text is enclosed in tags (as well as a div of class "poem")
 * Colons at the beginning of a line are converted into 1 em indentation
 * Spaces at the beginning of a line are preserved and no longer invoke the tag

The extension preserves wikilinks, bolding, etc. if they are present in the poem.

例
インデント付きの例

スタイル
The poem text is wrapped in a div, which has no style by default; but inherits any style or class option passed to the poem.

例えば、インデントされたテキストは、簡単な例では塗りつぶし防止やきれいな青枠を描くために使用できますが、長い行は改行されないので、場合によっては読みにくくなります. 同様の効果が得られますが、やや劣ります.

上記の例に当てはめると、次のようになります.

 In Xanadu did Kubla Khan A stately pleasure-dome decree: Where Alph, the sacred river, ran Through caverns measureless to man Down to a sunless sea.

So twice five miles of fertile ground With walls and towers were girdled round: And there were gardens bright with sinuous rills, Where blossomed many an incense-bearing tree; And here were forests ancient as the hills, Enfolding sunny spots of greenery.

"compact" option
Applying the tag with the compact option to a text of more than two lines, every line becomes a separate paragraph. (That is to say, it allows for more compact markup, not for a more compact output.)

Subsequent use of the tag with the compact option, with up to two newlines in between, gives just a single newline between texts, not a new paragraph.

Thus, applied to texts of more than two lines each, every line becomes a separate paragraph, except that the last line of each text and the first line of the next text are combined into one paragraph.

問題点と解決策

 * Variables and ParserFunctions do work inside the  container, but NOT within the  tag itself; this prevents templates with code such as.
 * One workaround is to use  instead.
 * Another way is to use the  magic word:.
 * NB: this would however seem not to work with the "compact" option.