Over the past weeks and months, User:Sanbeg has quietly and modestly put a lot of work into "Labeled Section Transclusion" as an extension feature to the Wikimedia Software. This includes code for the extension, test cases, and a new page at the Mediawiki software website describing his extension, which may be found here:
http://www.mediawiki.org/wiki/Labeled_Section_Transclusion
While I knew that something was going on (I "subscribe" to the updates on the bug), I still wasn't fully aware of the extent of his work and of the amazing flexibility and numerous features that User:Sanbeg put into this new tool. It incorporates every single feature that I personally requested, all those that others requested, and even some new ones that none of us at Wikisource previously even thought of but look very useful. It looks so useful, in fact, that I have no doubt it will be put to a great many unforseen uses that even go beyond Wikisource.
To my mind, this is no longer really just a Wikisource extension (though Wikisource certainly could use it), but is already something global: a tool that expands the basic flexibility of transclusion within the Mediawiki environment.
The last time this was brought up by Birgitte, Brion responded (as best I remember) that it was best to hold back for the meantime because there was still not full Wikisource agreement (on the talk page) about how such a tool should function. That was probably true then, but it is certainly no longer the case, because this tool, once again, addresses every possible need that has been expressed by anyone (at least as far as I can tell).
So what we really need now is some developer feedback!
Dovi
--------------------------------- Everyone is raving about the all-new Yahoo! Mail beta.
Over the past weeks and months, User:Sanbeg has quietly and modestly put a lot of work into "Labeled Section Transclusion" as an extension feature to the Wikimedia Software. This includes code for the extension, test cases, and a new page at the Mediawiki software website describing his extension, which may be found here:
[... snip ...]
So what we really need now is some developer feedback!
Dovi
I've just had a very quick look at it, and would only make 3 very minor comments:
Probably add a closing "?>" to the end of the file.
Line 156: "if (0){" : unreachable code, maybe delete or comment out.
<b>Fatal error</b>: Call to a member function getPrefixedText() on a non-object in <b>/var/www/hosts/mediawiki/extensions/lst/lst.php</b> on line <b>231</b><br /> Example malformed wiki text input which causes this: ------------- {{#lstx:</ includeonly> {|}} -------------
All the best, Nick.
"Nick Jenkins" nickpj@gmail.com wrote in message news:NABBJGECPILFNLFEAPIKIEHEJEAA.nickpj@gmail.com...
Over the past weeks and months, User:Sanbeg has quietly and modestly put
a lot of work into "Labeled Section
Transclusion" as an extension feature to the Wikimedia Software. This
includes code for the extension, test cases, and a
new page at the Mediawiki software website describing his extension,
which may be found here:
[... snip ...]
So what we really need now is some developer feedback!
Dovi
I've just had a very quick look at it, and would only make 3 very minor
comments:
Probably add a closing "?>" to the end of the file.
Line 156: "if (0){" : unreachable code, maybe delete or comment out.
<b>Fatal error</b>: Call to a member function getPrefixedText() on a
non-object in
<b>/var/www/hosts/mediawiki/extensions/lst/lst.php</b> on line
<b>231</b><br />
Example malformed wiki text input which causes this:
{{#lstx:</ includeonly> {|}}
All the best, Nick.
Thanks for finding those; I've uploaded a new version that fixes those.
Hopefully we can get this out, so we can start using it.
Thanks again -Steve
"Nick Jenkins" nickpj@gmail.com wrote in message news:NABBJGECPILFNLFEAPIKIEHEJEAA.nickpj@gmail.com...
Over the past weeks and months, User:Sanbeg has quietly and modestly put
a lot of work into "Labeled Section
Transclusion" as an extension feature to the Wikimedia Software. This
includes code for the extension, test cases, and a
new page at the Mediawiki software website describing his extension,
which may be found here:
[... snip ...]
So what we really need now is some developer feedback!
Dovi
I've just had a very quick look at it, and would only make 3 very minor
comments:
Probably add a closing "?>" to the end of the file.
Line 156: "if (0){" : unreachable code, maybe delete or comment out.
<b>Fatal error</b>: Call to a member function getPrefixedText() on a
non-object in
<b>/var/www/hosts/mediawiki/extensions/lst/lst.php</b> on line
<b>231</b><br />
Example malformed wiki text input which causes this:
{{#lstx:</ includeonly> {|}}
All the best, Nick.
Thanks for finding those; I've uploaded a new version that fixes those.
Hopefully we can get this out, so we can start using it.
Thanks again -Steve
So what we really need now is some developer feedback!
Dovi
I've just had a very quick look at it, and would only make 3 very minor comments:
Thanks; I've updated the extension to address those.
Hopefully we'll be able to get this into the SVN soon and start using it!
Thanks again -Steve
Thank you!
I've had a second quick look, and something separate is this:
In [[Main Page]] I have a bit of the page that contains: ------------------------------------ <section begin=ownage /> <script>alert("Ownage!");</script> <section end=ownage /> ------------------------------------
Then in another page I have: ------------------------------------ {{#lst:Main Page|ownage}} ------------------------------------
The result is that on saving or previewing that page, I get a JavaScript popup dialog box saying "Ownage!". That should not happen; instead what I should get is the following non-executable HTML in the output: ------------------------------------ <p><script>alert("Ownage!");</script> </p> ------------------------------------
Related to this and probably the same issue, is that if there is an image <gallery> wrapped in <section> tags, then the image gallery should display on the page that includes it via the {{#lst)).
All the best, Nick.
On Wed, 15 Nov 2006 21:15:19 +1100, Nick Jenkins wrote:
[snip]
I've had a second quick look, and something separate is this:
In [[Main Page]] I have a bit of the page that contains:
<section begin=ownage /> <script>alert("Ownage!");</script> <section end=ownage /> ------------------------------------
Then in another page I have:
{{#lst:Main Page|ownage}}
The result is that on saving or previewing that page, I get a JavaScript popup dialog box saying "Ownage!". That should not happen; instead what I should get is the following non-executable HTML in the output:
<p><script>alert("Ownage!");</script> </p> ------------------------------------
Related to this and probably the same issue, is that if there is an image <gallery> wrapped in <section> tags, then the image gallery should display on the page that includes it via the {{#lst)).
All the best, Nick.
Oh, that's not good. Setting noparse=>false in the return will fix that, but will also cause it to change the edit section links to point to the main document. I expect there's no way to get those right and resolve the edit sections correctly without some enhancement to the parser, such as allowing the parser function to return a title, or call back into the extension when it's done parsing.
Although at least that doesn't change the syntax, like when this enhancement was hooked directly into the parser, so maybe that could be done.
Thanks -Steve
On Wed, 15 Nov 2006 11:17:48 -0500, Steve Sanbeg wrote:
On Wed, 15 Nov 2006 21:15:19 +1100, Nick Jenkins wrote:
[snip]
I've had a second quick look, and something separate is this:
In [[Main Page]] I have a bit of the page that contains:
<section begin=ownage /> <script>alert("Ownage!");</script> <section end=ownage /> ------------------------------------
Then in another page I have:
{{#lst:Main Page|ownage}}
The result is that on saving or previewing that page, I get a JavaScript popup dialog box saying "Ownage!". That should not happen; instead what I should get is the following non-executable HTML in the output:
<p><script>alert("Ownage!");</script> </p> ------------------------------------
Related to this and probably the same issue, is that if there is an image <gallery> wrapped in <section> tags, then the image gallery should display on the page that includes it via the {{#lst)).
All the best, Nick.
Oh, that's not good. Setting noparse=>false in the return will fix that, but will also cause it to change the edit section links to point to the main document. I expect there's no way to get those right and resolve the edit sections correctly without some enhancement to the parser, such as allowing the parser function to return a title, or call back into the extension when it's done parsing.
Although at least that doesn't change the syntax, like when this enhancement was hooked directly into the parser, so maybe that could be done.
Thanks -Steve
OK, I seem to have found a better hook for the recursive parsing (as well as a competent newsreader), so we may be back in business. The new version seems to address these issues.
Thanks much! -Steve
OK, I seem to have found a better hook for the recursive parsing (as well as a competent newsreader), so we may be back in business. The new version seems to address these issues.
Thank you!
Had a quick third look at it, one small thing is that using this wiki input on a test page: ---------------------------------------- {{#lst:Main Page|/}} ----------------------------------------
Which when error_reporting(E_ALL); is included in LocalSettings.php, will cause these PHP warnings: ---------------------------------------- <br /> <b>Warning</b>: preg_match_all() [<a href='function.preg-match-all'>function.preg-match-all</a>]: Unknown modifier '' in <b>/var/www/hosts/mediawiki/extensions/lst/lst.php</b> on line <b>174</b><br /> <br /> <b>Warning</b>: Invalid argument supplied for foreach() in <b>/var/www/hosts/mediawiki/extensions/lst/lst.php</b> on line <b>176</b><br /> ----------------------------------------
Also managed to get an "Unknown modifier 'z'" on the same line, by doing "{{#lst:Main Page|/iz}}", but it's probably the same thing as the above.
Other than that, it's looking good.
All the best, Nick.
On Thu, 16 Nov 2006 15:46:29 +1100, Nick Jenkins wrote:
OK, I seem to have found a better hook for the recursive parsing (as well as a competent newsreader), so we may be back in business. The new version seems to address these issues.
Thank you!
Had a quick third look at it, one small thing is that using this wiki input on a test page:
{{#lst:Main Page|/}}
Which when error_reporting(E_ALL); is included in LocalSettings.php, will cause these PHP warnings:
<br /> <b>Warning</b>: preg_match_all() [<a href='function.preg-match-all'>function.preg-match-all</a>]: Unknown modifier '\' in <b>/var/www/hosts/mediawiki/extensions/lst/lst.php</b> on line <b>174</b><br /> <br /> <b>Warning</b>: Invalid argument supplied for foreach() in <b>/var/www/hosts/mediawiki/extensions/lst/lst.php</b> on line <b>176</b><br /> ----------------------------------------
Also managed to get an "Unknown modifier 'z'" on the same line, by doing "{{#lst:Main Page|/iz}}", but it's probably the same thing as the above.
Other than that, it's looking good.
All the best, Nick.
Oh, I guess \Q doesn't work with variables like in perl; good to know. When I changed that to preg_quote(), those errors when away, so now it works with a section called "/".
Thanks again -Steve
Oh, I guess \Q doesn't work with variables like in perl; good to know. When I changed that to preg_quote(), those errors when away, so now it works with a section called "/".
Thanks again -Steve
Thank you!
Checked into SVN in r17736. Only tiny changes made were to add the '$wgParserTestFiles[] = ' line (which invokes the LST tests whenever parserTests is run and the extension is enabled), and update the format of the header line in the "Transcluded section headings create edit link to template" test to match the header format used in SVN head (which differs slightly from that used in 1.8 and earlier).
All the best, Nick.
Nick Jenkins wrote:
Oh, I guess \Q doesn't work with variables like in perl; good to know. When I changed that to preg_quote(), those errors when away, so now it works with a section called "/".
Thanks again -Steve
Thank you!
Checked into SVN in r17736. Only tiny changes made were to add the '$wgParserTestFiles[] = ' line (which invokes the LST tests whenever parserTests is run and the extension is enabled), and update the format of the header line in the "Transcluded section headings create edit link to template" test to match the header format used in SVN head (which differs slightly from that used in 1.8 and earlier).
So, when/where can we see it in action? On the testwiki?
So, when/where can we see it in action? On the testwiki?
If you just want to play with it, you can see it doing something simple at: http://theplaypit.nickj.org/wiki/index.php?title=Page , and you're more than welcome to create any test pages you like on that wiki if you want to play with it. The documentation at http://www.mediawiki.org/wiki/Labeled_Section_Transclusion covers the syntax and how to use it.
If you want to play with it on the cluster though, that's not something I can answer.
All the best, Nick.
wikitech-l@lists.wikimedia.org