Extension:Poem/fr
Poem État de la version : stable |
|
---|---|
Implémentation | Balise |
Description | Adds <poem> tag for poem formatting |
Auteur(s) | Nikola Smolenskidiscussion |
Dernière version | continuous updates |
MediaWiki | 1.25+ |
Modifie la base de données |
Non |
Licence | Licence Creative Commons Zero v1.0 Universal |
Téléchargement | |
<poem> |
|
Téléchargements trimestriels | 46 (Ranked 91st) |
Utilisé par les wikis publics | 10,039 (Ranked 12th) |
Traduire l’extension Poem sur translatewiki.net si elle y est disponible | |
Problèmes | Tâches ouvertes · Signaler un bogue |
The Poem extension allows easy formatting of poems and similar material within Wikitexte .
Once the extension is enabled, you can put any block of text within <poem></poem>
tags, which has the following effects:
- All newlines are preserved by converting them into
<br />
tags
- The block of text is enclosed in
<p>...</p>
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
<pre>
tag
The extension preserves wikilinks, bolding, etc. if they are present in the poem.
Usage
Example
Input text | Output |
---|---|
<poem>
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.
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>
|
In Xanadu did Kubla Khan |
Example with indentation
Input text | Output |
---|---|
<poem>
Une terre au flanc maigre, âpre, avare, inclément
Où les vivants pensifs travaillent tristement,
::Et qui donne à regret à cette race humaine
Un peu de pain pour tant de labeur et de peine ;
::Des hommes durs, éclos sur ces sillons ingrats ;
Des cités d’où s’en vont, en se tordant les bras,
::La charité, la paix, la foi, sœurs vénérables ;
L’orgueil chez les puissants et chez les misérables ;
</poem>
|
Une terre au flanc maigre, âpre, avare, inclément |
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.
For example, while indented text can be used for simple examples to prevent filling and draw a nice blue box, it can be hard to read in some cases, since long lines aren't broken. A similar, but somewhat better effect can be obtained with:
<poem style="border: 2px solid #d6d2c5; background-color: #f9f4e6; 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
Applying the <poem>
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 <poem>
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.
Input | Output | Input | Output |
---|---|---|---|
<poem>
One,
Two.
</poem>
<poem>
Three?
Four!
</poem>
|
One, Three? |
<poem compact>
One,
Two.
</poem>
<poem compact>
Three?
Four!
</poem>
|
One,
Two. Three?
Four! |
Input | Output | Input | Output |
---|---|---|---|
<poem>
One,
Two.
Extra.
</poem>
<poem>
Three?
Four!
Extra.
</poem>
|
One, Three? |
<poem compact>
One,
Two.
Extra.
</poem>
<poem compact>
Three?
Four!
Extra.
</poem>
|
One,
Two. Three?
Four! |
Problems and solutions
- Variables and ParserFunctions do work inside the
<poem>...</poem>
container, but NOT within the<poem ... >
tag itself; this prevents templates with code such as<poem style="{{{1}}}">
. - One workaround is to use
<div style="{{{1}}}"><poem> ... </poem></div>
instead. - Another way is to use the
#tag
magic word: {{#tag:poem| ... |style="{{{1}}}"}}.- NB: this would however seem not to work with the "compact" option.
Input (inside OK, within not OK) | Output |
---|---|
<poem style="{{{1|border: 1px solid Black;}}}">
One,
{{{2|Two.}}}
</poem>
|
One, |
Input (both inside and within OK) | Output |
<div style="{{{1|border: 1px solid Black;}}}">
<poem>
One,
{{{2|Two.}}}
</poem>
</div>
|
One, |
{{#tag:poem|
One,
{{{2|Two.}}}
|style="{{{1|border: 1px solid Black;}}}"
}}
|
One, |
Installation
- Téléchargez et placez le(s) fichier(s) dans un répertoire appelé
Poem
dans votre dossierextensions/
.
Les développeurs et les contributeurs au code doivent à la place installer l'extension à partir de Git en utilisant:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Poem - Ajoutez le code suivant à la fin de votre fichier LocalSettings.php :
wfLoadExtension( 'Poem' );
- Fait – Accédez à Special:Version sur votre wiki pour vérifier que l'extension a bien été installée.
Installation Vagrant :
- Si vous utilisez Vagrant , installez avec
vagrant roles enable poem --provision
Cette extension est utilisée par au moins un des projets Wikimédia. Cela signifie probablement que l’extension est assez stable et fonctionnelle pour être utilisée sur des sites à fort trafic. Recherchez le nom de cette extension dans le CommonSettings.php de Wikimédia et dans le fichier de configuration InitialiseSettings.php pour situer les endroits où elle est installée. Une liste complète des extensions installées sur un Wiki donné peut être visualisée sur la page Special:Version de ce wiki. |
Cette extension est incluse dans les fermes de wikis ou les hôtes suivants et / ou les paquets : Cette liste ne fait pas autorité. Certaines fermes de wikis ou hôtes et / ou paquets peuvent contenir cette extension même s'ils ne sont pas listés ici. Vérifiez toujours cela avec votre ferme de wikis ou votre hôte ou votre paquet avant de confirmer. |
- Extensions bundled with MediaWiki 1.21/fr
- Stable extensions/fr
- Tag extensions/fr
- Public domain licensed extensions/fr
- Extensions in Wikimedia version control/fr
- ParserFirstCallInit extensions/fr
- All extensions/fr
- Extensions used on Wikimedia/fr
- Extensions included in BlueSpice/fr
- Extensions included in Canasta/fr
- Extensions available as Debian packages/fr
- Extensions included in Fandom/fr
- Extensions included in Miraheze/fr
- Extensions included in MyWikis/fr
- Extensions included in ProWiki/fr
- Extensions included in semantic::core/fr
- Extensions included in ShoutWiki/fr
- Extensions included in Telepedia/fr
- Extensions included in wiki.gg/fr
- Extensions included in WikiForge/fr