Wiki della Community
Advertisement
Wiki della Community

L'estensione Poem permette la facile inclusione di poesie e materiali simili sugli articoli, semplicemente inserendoli all'interno dei tag <poem></poem>, invece di aggiungere <br> alla fine o : all'inizio di ogni riga.

Come funziona

L'estensione preserva i link, il grassetto, etc. se sono presenti nella poesia, così come righe che iniziano con degli spazi. Nota che gli spazi saranno renderizzati con il font scelto e potrebbero avere larghezze diverse a seconda del font.

Iniziare una righa con i due punti (:) inserirà la riga in un tag <span class="mw-poem-indented" style="margin-left: 1em;"> con un margine sinistro di +1em per ciascun ":". Puoi quindi utilizzare la classe mw-poem-indented per applicare stili aggiuntivi alle righe indentate.

Esempio semplice

Il seguente testo in modalità sorgente:

<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>

renderizza come:

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.

Applicare stili alla poesia

Il testo della poesia è racchiuso in un div, che non ha stile di default ma che eredita qualsiasi opzione style o class passata al tag poem.

Per esempio: <poem style="text-align: center; border: 2px dashed #2f6fab; background-color: #eeeeee; color: #000; padding: 1em;">

Esempio

Il seguente testo in modalità sorgente:

<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>

renderizza come:

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.

Opzione "compact"

Normalmente, il parser renderizza ciascuna poesia in un paragrafo (tag <p>) dentro il <div>. Occasionalmente questo non è desiderato; usare l'opzione compact (<poem compact>) sopprime i paragrafi nella poesia, per permette a poesi compatte adiacenti di adattarsi meglio insieme.

Vedi anche

Aiuto aggiuntivo e feedback

Advertisement