Extension talk:Poem

From MediaWiki.org
Jump to: navigation, search
Start a new discussion

Poem combined with Proofread.Transclusion function

I wonder: can the Poem extension work properly when it is used in conjunction with the Transclusion function of the Proofread Extension? If saying more specifically: can this work when the opening tag <poem> and the closing tag </poem> are placed on different pages (e.g. closing tag is on the page next to the one where the opening tag resides) and the poetry lines flow between starting and ending page? I think currently this wouldn't work - am I right?

More detailed explanation of the issue case:

when I place such code on two neighboring proofread pages:

  • at the end of the first page - section named let us say "page_1_sec_2"
## page_1_sec_2 ##
<table align=center><tr><td><poem>First M lines
  • at the start of the second page - section named let us say "page_2_sec_1":
## page_2_sec_1 ##
Last N lines</poem></td></tr></table>
####

and I transclude the sections with a command like:

<pages index="The book.djvu" from=1 fromsection=page_1_sec_2 to=2 tosection=page_2_sec_1 />

then I got that only the first part (from "page_1_sec_2") of the poetry is displayed properly on the transclusion page, but the second part (last N lines) flows without linebreaks, and finally the closing tag </poem> is visually displayed - it seems like it is not treated as the closing tag.

I encountered this while working in the Multilingual Wikisource. Currently I found rude workaround, but without using the "poem" tag, and I was forced to insert <br/> tags as linebreaks.

Really: is there a way how to get these functions to work together? Or maybe some improvements may be introduced into the Mediawiki software to support this case too? --Nigmont (talk) 19:33, 6 March 2015 (UTC)

Nigmont (talk)19:33, 6 March 2015

The <poem> tag works fine in a transcluded page, though you you need to terminate it on the same page that it starts, and put a new tag on the next page. We do it all the time at English Wikisource. It simply needs to be open and closed often if you are looking to do more complex coding, and when using templates with it you need to use it with the magic tag {{#tag:...}}

There are numbers of limitations with poem and you just need to work within them.

billinghurst sDrewth04:52, 7 March 2015

Just now I have tried as you said (to put both opening and closing "poem" tags on each transcluded page), and it works well. Thank you very much, your reply is very helpful!

--Nigmont (talk)12:25, 7 March 2015
 
 

poem with VisualEditor

I would love to be able to edit text marked as poem with the visualeditor. Is that possible in any way?

Thanks.

Robert

Robertgarrigos (talk)15:15, 4 February 2015

No, it's not currently possible, but you can follow phab:T45120 for updates.

Ricordisamoa02:39, 5 February 2015
 

PHP 5.5.13 preg_replace_callback error

preg_replace_callback(): Requires argument 2, 'Poem::replaceSpaces', to be a valid callback in ... 
$text = preg_replace_callback( '/^( +)/m', array( 'Poem', 'replaceSpaces' ), $text );
Subfader (talk)16:12, 4 January 2015

The =-sign within a text that's part of a poem embedded in a template.

Willeeuwis (talk) 07:14, 11 May 2012 (UTC)

I have a simple template:

<div style="padding-left:20px; border-left:1px solid black">
<poem>
{{{1}}}
</poem>
</div>

When I write:

<poem>
1 + 1 = 2
</poem>

This results, as expected, in:

1 + 1 = 2

When write:

{{quote|1 + 1 = 2}}

This results in (with the lay out as decalred by the div style):

{{{1}}}

Writing:

{{quote|1 + 1 <nowiki>=</nowiki> 2}}

solves the problem, but why the difference. Is it the template that does this? Can this be "undone"?

Willeeuwis (talk)07:14, 11 May 2012

In general, the behavior of an extension tag as poem or ref included into a template is umpredictable (I suppose, from exoteric priorities into parsing). Often the issue is solved using #tag syntax instead of the extension tag. I.e. this solves the unpleasant issue of "a ref inside of a ref [1]".

Explore the #tag syntax if you did never do before! Alex brollo (talk)

first level references
  1. This is a first-level ref[a 1]
second level references
  1. and this is a second-level ref [b 1]:-)
third level references
  1. and this is a third-level ref :-)
Alex brollo (talk)20:07, 25 May 2012
 

This is because when you write {{quote|1 + 1 = 2}} the parser thinks you wish to invoke {{quote}} with a single parameter named "1 + 1". If you have a named parameter, it does not get assigned a number: that's only for anonymous parameters. So {{{1}}} does not have a value, and you have not used a pipe to indicate a default value, so you get the raw parameter showing up as above.

Phil | Talk17:38, 1 July 2014
 

Pointer to discussion about "lines"

Regarding <lines> as an alternate names. There was a comment at http://lists.wikimedia.org/pipermail/wikitech-l/2014-February/074337.html which pointed to https://bugzilla.wikimedia.org/show_bug.cgi?id=52061 and https://gerrit.wikimedia.org/r/#/c/106861/

Just noting for future reference.

Quiddity (talk)18:41, 30 June 2014

How to number verses?

Do you have any solution on numbering verses with this extension? like

Spento il diurno raggio in occidente,
E queto il fumo delle ville, e queta
De' cani era la voce e della gente;
Quand'ella, volta all'amorosa meta,
Si ritrovò nel mezzo ad una landa.................5
Quanto foss'altra mai vezzosa e lieta.
Spandeva il suo chiaror per ogni banda
La sorella del sole, e fea d'argento
Gli arbori ch'a quel loco eran ghirlanda.
I ramoscelli ivan cantando al vento,............10
E in un con l'usignol che sempre piagne
Fra i tronchi un rivo fea dolce lamento.
Limpido il mar da lungi, e le campagne
E le foreste, e tutte ad una ad una
Le cime si scoprian delle montagne.............15
In queta ombra giacea la valle bruna,
E i collicelli intorno rivestia
Del suo candor la rugiadosa luna.

Thanks

Emilio Speciale (talk)18:55, 15 September 2013

I suppose you already know that Wikisources have their own tricks for this? They use templates for the number and a CSS class for the dots. I'm afraid the extension doesn't help with this, or if it does nobody discovered it yet!

Nemo07:01, 18 September 2013

Thank you for your answer. I hope someone has some suggestions. Have a nice day.

Emilio Speciale (talk)12:13, 7 November 2013
 
 

Class 'Html' not found in extensions/Poem/Poem.class.php on line 56

Any time I try to add the poem tag, the page crashes and I get the message " Class 'Html' not found in /var/lib/mediawiki/extensions/Poem/Poem.class.php on line 56" in the apache error.log.

168.91.255.10015:35, 13 March 2013

In which wikisource are you working? Can you give me the name of a page where such error pops out? And please - have you an user name somewhere?

Alex brollo (talk)20:16, 14 April 2013