Re: Text_Wiki/Mediawiki/Wikipedia
| From: | bertrand Gugger | Date: | Tue, 13 Jun 2006 11:07:31 +0000 |
| Subject: | Re: Text_Wiki/Mediawiki/Wikipedia | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24336@lists.php.net to get a copy of this message | ||
Bonjour,
Graeme Merrall wrote:
Hi there. Forgive the direct mail but traffic on both the Text_Wiki list and pear-general is a bit light around Text_Wiki discussion.Sorry about that, but Text_Wiki has some kind of "very technical" target and will never become a popular one :) However, if you don't post such question on the list , you won't help to change that. As said previously, I'm no more listed as a dev , so please, use the lists.
I've been tinkering with Text_Wiki_Mediawiki to parse the output from Wikipedia's "Special:Export" function for example http://en.wikipedia.org/wiki/Special:Export/2006_FIFA_World_Cup so I can display the output on smaller screen devices such as my PDA. On the whole the class gets most things fine but I've needed to make some minor modifications to the mediawiki parser classes to accomodate some new items such as the paths to images which are based on md5 and thumbnails vs larger images. I'm wondering what's the best way to manage these extra changes. Due to the complexity of the code layout I don't think I can override the wikilink file individually. Is copying all the files and renaming the base class from Text_Wiki_Mediawiki to Text_Wiki_Wikipedia and altering the addpath() method in the constructor the way to go?Normally, you can override any rule by just adding a path [1] to a folder having your customized rules (as Wikilink.php). Text_Wiki will take these ones in priority and not the Mediawiki ones (actually Mediawiki also uses some rules from Default on the same principle)
Finally, I'm curious about the behaviour of external links. For example in wikipedia output, an external link in the page content is printed as [1] which is linked to the external site. Have you got any thoughts about how best to handle that? I suspect it's another wikilink rule to handle external links as they're surrounded by [] in the source.It's already done in the Url rule ... a [link] without description should be transformed in such footnote thing... fill a bug report if not working. Regards -- toggg [1] http://wiki.ciaweb.net/yawiki/index.php?area=Text_Wiki&page=MethodAddPath