(Undo revision 6785 by 35.13.201.134 (talk)) |
No edit summary |
||
(33 intermediate revisions by 23 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{Extension infobox |
||
− | {{enabled by default}} |
||
+ | | name = Poem |
||
+ | | author = |
||
+ | * Nikola Smolenski |
||
+ | * Brion Vibber |
||
+ | * Steve Sanbeg |
||
+ | | link = [[mw:Extension:Poem|MediaWiki.org]] |
||
+ | | desc = {{int:poem-desc}} |
||
+ | | default = yes |
||
⚫ | |||
+ | {{tocright}} |
||
⚫ | |||
+ | == How it works == |
||
⚫ | The '''poem extension''' allows for easy inclusion of poems and similar material |
||
+ | The extension preserves [[Help:Links|wikilinks]], bolding, ''etc.'' if they are present in the poem, as well as lines that begin with spaces. Note that the spaces will be rendered in whatever font is being used and will have different widths based on the font. |
||
+ | Beginning a line with a colon (<code>:</code>) will wrap the line in a <code><span class="mw-poem-indented" style="margin-left: 1em;"></code> tag with a left margin of <code>+1em</code> for each colon. You may use the <code>mw-poem-indented</code> class to apply additional styling to indented lines. |
||
− | ==Example== |
||
+ | |||
− | {| cellspacing=5 |
||
+ | === A simple example === |
||
− | !Input text |
||
+ | The following text in Source mode: |
||
− | !Output |
||
+ | <pre> |
||
− | |- |
||
− | + | <poem> |
|
− | In |
+ | In Xanadu did [[wikipedia:Kubla Khan|Kubla Khan]] |
A stately pleasure-dome decree: |
A stately pleasure-dome decree: |
||
− | Where Alph, the sacred river, ran |
+ | :Where Alph, the sacred river, ran |
Through caverns measureless to man |
Through caverns measureless to man |
||
− | Down to a sunless sea. |
+ | Down to a sunless sea. |
So twice five miles of fertile ground |
So twice five miles of fertile ground |
||
Line 21: | Line 33: | ||
And here were forests ancient as the hills, |
And here were forests ancient as the hills, |
||
Enfolding sunny spots of greenery. |
Enfolding sunny spots of greenery. |
||
− | </poem |
+ | </poem> |
+ | </pre> |
||
− | |valign=top| |
||
+ | renders as: |
||
<poem> |
<poem> |
||
− | In |
+ | In Xanadu did [[wikipedia:Kubla Khan|Kubla Khan]] |
A stately pleasure-dome decree: |
A stately pleasure-dome decree: |
||
− | Where Alph, the sacred river, ran |
+ | :Where Alph, the sacred river, ran |
Through caverns measureless to man |
Through caverns measureless to man |
||
− | Down to a sunless sea. |
+ | Down to a sunless sea. |
So twice five miles of fertile ground |
So twice five miles of fertile ground |
||
Line 37: | Line 50: | ||
Enfolding sunny spots of greenery. |
Enfolding sunny spots of greenery. |
||
</poem> |
</poem> |
||
⚫ | |||
+ | == Styling a poem == |
||
− | ==Style== |
||
− | 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. |
+ | 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 |
+ | For example: <code><nowiki><poem style="text-align: center; border: 2px dashed #2f6fab; background-color: #eeeeee; color: #000; padding: 1em;"></nowiki></code> |
− | When applied to the above example, the result is as follows: |
||
⚫ | |||
− | In [[Wikipedia:Xanadu|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. |
||
+ | ===Styling example=== |
||
− | So twice five miles of fertile ground |
||
+ | The following text in Source mode: |
||
− | With walls and towers were girdled round: |
||
+ | <pre> |
||
− | And there were gardens bright with sinuous rills, |
||
⚫ | |||
− | Where blossomed many an incense-bearing tree; |
||
+ | The limerick packs laughs anatomical |
||
− | And here were forests ancient as the hills, |
||
+ | Into space that is quite economical. |
||
− | Enfolding sunny spots of greenery. |
||
+ | But the good ones I’ve seen |
||
+ | So seldom are clean |
||
+ | And the clean ones so seldom are comical. |
||
</poem> |
</poem> |
||
+ | </pre> |
||
+ | renders as: |
||
+ | <poem style="text-align: center; border: 2px dashed #2f6fab; background-color: #eeeeee; color: #000; padding: 1em;"> |
||
+ | The limerick packs laughs anatomical |
||
+ | Into space that is quite economical. |
||
+ | But the good ones I’ve seen |
||
+ | So seldom are clean |
||
+ | And the clean ones so seldom are comical. |
||
+ | </poem> |
||
+ | |||
⚫ | |||
⚫ | Normally, the parser renders each poem in a paragraph (<code><p></code> tag) inside the <code><div></code>. Occasionally this is not desired; using the ''compact'' option (<code><poem compact></code>) suppresses paragraphs in the poem, to allow adjacent compact poems to blend together. |
||
+ | |||
+ | == See also == |
||
+ | * [[Help:HTML|HTML]] and [[Help:Wikitext|Wikitext help]] |
||
+ | * [[mw:Extension:Poem|Extension:Poem]] at MediaWiki.org |
||
+ | == Further help and feedback == |
||
⚫ | |||
+ | {{Help and feedback section}} |
||
⚫ | |||
+ | [[fr:Aide:Poem]] |
||
⚫ | |||
+ | [[hi:सहायता:कविता]] |
||
+ | [[pl:Pomoc:Poezja]] |
||
+ | [[pt:Ajuda:Poema]] |
||
+ | [[ru:Справка:Стихи]] |
||
+ | [[tr:Yardım:Şiir]] |
||
+ | [[uk:Довідка:Вірші]] |
||
+ | [[vi:Trợ giúp:Thơ]] |
||
+ | [[zh:Help:詩歌]] |
||
⚫ |
Revision as of 12:47, 6 May 2021
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.
How it works
The extension preserves wikilinks, bolding, etc. if they are present in the poem, as well as lines that begin with spaces. Note that the spaces will be rendered in whatever font is being used and will have different widths based on the font.
Beginning a line with a colon (:
) will wrap the line in a <span class="mw-poem-indented" style="margin-left: 1em;">
tag with a left margin of +1em
for each colon. You may use the mw-poem-indented
class to apply additional styling to indented lines.
A simple example
The following text in Source mode:
<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>
renders as:
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="text-align: center; border: 2px dashed #2f6fab; background-color: #eeeeee; color: #000; padding: 1em;">
Styling example
The following text in Source mode:
<poem style="text-align: center; border: 2px dashed #2f6fab; background-color: #eeeeee; color: #000; padding: 1em;"> The limerick packs laughs anatomical Into space that is quite economical. But the good ones I’ve seen So seldom are clean And the clean ones so seldom are comical. </poem>
renders as:
The limerick packs laughs anatomical
Into space that is quite economical.
But the good ones I’ve seen
So seldom are clean
And the clean ones so seldom are comical.
"Compact" option
Normally, the parser renders each poem in a paragraph (<p>
tag) inside the <div>
. Occasionally this is not desired; using the compact option (<poem compact>
) suppresses paragraphs in the poem, to allow adjacent compact poems to blend together.
See also
- HTML and Wikitext help
- Extension:Poem at MediaWiki.org
Further help and feedback
- Browse and search other help pages at Help:Contents
- Check Fandom Community Central for sources of further help and support
- Check Contacting Fandom for how to report any errors or unclear steps in this article