FANDOM


Ekstensi ini terhubung secara otomatis di Fandom.
Ekstensi poem memungkinkan untuk dimasukkannya poem dengan mudah dan materi serupa pada artikel, cukup dengan menempatkannya di antara tag

 

alih-alih menambahkan
ke akhir atau: ke awal setiap baris.

Untuk mempertahankan wikilinks, huruf tebal, dll. Jika ada dalam poem itu, dan juga garis indentasi yang dimulai dengan spasi.

Contoh Sunting

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

Di Xanadu melakukan Kubla Khan
Dekrit kesenangan-kubah:
Di mana Alph, sungai suci, berlari
Melalui gua-gua yang tak terukur bagi manusia
Turun ke laut tanpa matahari.

Jadi tanah subur dua kali lima mil
Dengan dinding dan menara yang bundar:
Dan ada taman-taman yang cerah dengan pohon berliku,
Di mana mekar banyak pohon yang mengandung dupa;
Dan di sini ada hutan purba seperti bukit,
Menutupi tempat-tempat hijau yang cerah.

Styling PoemSunting

Teks puisi diberikan dengan div, yang tidak memiliki gaya secara default, tetapi mewarisi opsi gaya atau kelas yang diteruskan ke poem tersebut.

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

Disaat digunakan disuatu artikel akan menjadi seperti dibawah ini:

Di Xanadu melakukan Kubla Khan
Dekrit kesenangan-kubah:
Di mana Alph, sungai suci, berlari
Melalui gua-gua yang tak terukur bagi manusia
Turun ke laut tanpa matahari.

Jadi tanah subur dua kali lima mil
Dengan dinding dan menara yang bundar:
Dan ada taman-taman yang cerah dengan pohon berliku,
Di mana mekar banyak pohon yang mengandung dupa;
Dan di sini ada hutan purba seperti bukit,
Menutupi tempat-tempat hijau yang cerah.

Pilihan "Compact" Sunting

Biasanya, parser menerjemahkan setiap poem dalam paragraf. Kadang-kadang ini tidak diperlukan; menggunakan pilihan ''compact'' (<code>&lt;poem compact&gt;</code>) menekan baris baru dalam poem, untuk memungkinkan poem compact yang berdekatan bersama.

Lihat Juga Sunting

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.

UCP

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.

On the UCP, 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 on UCP

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.

Legacy

The poem extension on legacy wikis works as described above with a few exceptions:

  • Beginning a line with a colon (:) will wrap the line in <dl><dd> tags which add additional margins to the text.
  • The paragraph (<p>) tag may not wrap the entire poem text, making the spacing uneven.

See also

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