FANDOM


This extension is enabled by default on Fandom.

The poem extension allows for easy inclusion of poems and similar material on articles, by simply putting them between <poem></poem> tags, instead of adding <br> to the end or : to the beginning of every line.

The extension preserves wikilinks, bolding, etc. if they are present in the poem, as well as indenting lines which start with spaces.

An example

Input
<poem>
In Xanadu did [[wikipedia:Kubla Khan|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.
</poem>
Output

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.

Styling a 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.

For example: <poem style="border: 2px dashed #2f6fab; background-color: #eeeeee; color: #000; padding: 1em;">

When applied to the above example, the result is as follows:

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

Normally, the parser renders each poem in a paragraph. Occasionally this is not desired; using the compact option (<poem compact>) suppresses newlines in the poem, to allow adjacent compact poems to blend together.

See also

Community content is available under CC-BY-SA unless otherwise noted.