Email This Post
|
Print This Post
MediaWiki is used extensively for documentation sites simply because it has so many features that make it ideal for this type of wiki application. The primary example is, of course Wikipedia
Naturally, I want to use MediaWiki for my own documentation sites. However, I use Textile – a lightweight, humane web text generator almost exclusively wherever HTML markup would otherwise be used. Also, I have to admit that I find the built-in MediaWiki markup verbose, ugly and counter-intuitive.
So, I was pleased to find a well written and documented MediaWiki extension which provides for alternative parsers, including textile. For some reason, the standard extension does not work on my sites. What I describe here is a simple mechanism to replace the TextilePHP parser with the Textile2 parser.
Install the MediaWiki AlternativeSyntaxParser extension. Test it and if it works for you you’re done!
If the basic installation does not work, or if you want to try Textile2, add the following lines to AlternativeSyntaxParser.php at about line #153
56910bd65036e03ec7e38b71657bf46f000
Download the Textile2 source from here& and copy the file classTextile.php to the same directory where the alternative parsers are.
Actually, you’re done! You now have another alternative parser ‘textile2’ available.
Once you have installed this, the editor buttons are no longer useful… maybe I’ll integrate TheEditorHelper unless someone else gets it done first.
3 Responses
Jim R. Wilson
September 4th, 2007 at 4:42 pm
1Hi Nigel,
Thanks for trying out my AlternateSyntaxParser – glad you like it!
Two quick notes:
1) Since the Textile class provided by Textile2 is the same as for original Textile, there’s no need to hack the extension code in any way. All you have to do is rename ‘classTextile.php’ to just ‘Textile.php’ – and that should be it.
2) In the event that it was going to be more complicated, the preferred way to add a new language is to create a new MediaWiki extension that hooks into the ‘AlternateSyntaxParser’ hook which I created expressly for this purpose. (Admittedly though, that particular feature is not documented).
Thanks again, and I’ll be happy to answer any questions.
Nigel Ball
September 4th, 2007 at 8:26 pm
2Thanks for the comment Jim…
As far as I could tell, the calling methods for Textile and Textile2 seemed to be different, hence the “hack”
I’ll see if I can work out how to use the hook. If I do work it out I’ll post the result.
Eric Larson
October 13th, 2007 at 7:17 am
3I had to add the hack to get MW 1.11 to render Textile—otherwise it was all 500 error. – EL
RSS feed for comments on this post · TrackBack URI
Leave a reply
Technorati
Topics
Blogroll
Links
My Blogs