Difference between revisions 234228 and 298320 on testwiki#REDIRECT [[Poem1'''For TTO's poem testing''' hey! <poem> this is a test </poem> == Usage == === Example === {| cellspacing="5" !Input text !Output |- |valign="top"|<pre><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></pre> |valign="top"| <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> |} === Example with indentation === {| cellspacing="5" !Input text !Output |- |valign="top"|<pre><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></pre> |valign="top"| <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> |} === 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 <pre><poem style="border: 2px solid #d6d2c5; background-color: #f9f4e6; padding: 1em;"></pre> When applied to the above example, the result is as follows: <poem style="border: 2px solid #d6d2c5; background-color: #f9f4e6; padding: 1em;"> 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> === "compact" option === Applying the <nowiki><poem></nowiki> tag with the ''compact'' option to a text of more than two lines, every line becomes a separate paragraph. (This seems to be a bug, as it is opposite to what the term suggests.) Subsequent use of the <nowiki><poem></nowiki> 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. {| cellspacing="5" !Input !Output !Input !Output |- |valign="top"|<pre><poem> One, Two. </poem> <poem> Three? Four! </poem></pre> |valign="top"| <poem> One, Two. </poem> <poem> Three? Four! </poem> |valign="top"|<pre><poem compact> One, Two. </poem> <poem compact> Three? Four! </poem></pre> |valign="top"| <poem compact> One, Two. </poem> <poem compact> Three? Four! </poem> |} {| cellspacing="5" !Input !Output !Input !Output |- |valign="top"|<pre><poem> One, Two. Extra. </poem> <poem> Three? Four! Extra. </poem></pre> |valign="top"| <poem> One, Two. Extra. </poem> <poem> Three? Four! Extra. </poem> |valign="top"|<pre><poem compact> One, Two. Extra. </poem> <poem compact> Three? Four! Extra. </poem></pre> |valign="top"| <poem compact> One, Two. Extra. </poem> <poem compact> Three? Four! Extra. </poem> |} === Problems and solutions === * Variables and ParserFunctions do work inside the <nowiki><poem> ... </poem></nowiki> container, but NOT within the <nowiki><poem ... ></nowiki> tag itself ; this prevents templates with code such as <nowiki><poem style="{{{1}}}"></nowiki>. * One workaround is to use <nowiki><div style="{{{1}}}"><poem> ... </poem></div></nowiki> instead. * Another way is to use the <code>#tag</code> [[Help:Magic words#Miscellaneous|magic word]]: <nowiki>{{#tag:poem| ... |style="{{{1}}}"}}</nowiki>. ** NB: this would however seem not to work with the "compact" option. {| cellspacing="5" !Input (inside OK, within not OK) !Output |- |valign="top"|<pre><poem style="{{{1|border: 1px solid Black;}}}"> One, {{{2|Two.}}} </poem></pre> |valign="top"| <poem style="{{{1|border: 1px solid Black;}}}"> One, {{{2|Two.}}} </poem> |- !Input (both inside and within OK) !Output |- |valign="top"|<pre><div style="{{{1|border: 1px solid Black;}}}"><poem> One, {{{2|Two.}}} </poem></div></pre> |valign="top"| <div style="{{{1|border: 1px solid Black;}}}"><poem> One, {{{2|Two.}}} </poem></div> |- |valign="top"|<pre>{{#tag:poem| One, {{{2|Two.}}} |style="{{{1|border: 1px solid Black;}}}" }}</pre> |valign="top"| {{#tag:poem| One, {{{2|Two.}}} |style="{{{1|border: 1px solid Black;}}}" }} |} [[Category:Valuable pages]] All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://test.wikipedia.org/w/index.php?diff=prev&oldid=298320.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|