Version 4 (modified by 10 years ago) (diff) | ,
---|
MediaWiki language processor
Description
Plugin introduces new wiki macro `mediawiki'. Macro turns trac wiki into pure mediawiki. It is based on this script.
Bugs/Feature Requests
Existing bugs and feature requests for MediaWikiPluginMacro are here.
If you have any issues, create a new ticket.
Download
Download the zipped source from [download:mediawikipluginmacro here].
Installation
unzip mediawikipluginmacro.zip cd mediawikipluginmacro ### next step (patch) only for python 2.3 patch <<EOP diff -ruNb mediawiki.orig/parser.py mediawiki/parser.py --- mediawiki.orig/parser.py 2007-07-13 15:17:50.000000000 +0200 +++ mediawiki/parser.py 2008-04-25 11:00:59.000000000 +0200 @@ -5,7 +5,7 @@ """ import re, random, math, locale -from base64 import b64encode, b64decode +from base64 import decodestring from trac.core import * from trac.wiki.api import IWikiMacroProvider @@ -920,7 +920,10 @@ def slugify(text): """docstring for slugify""" - return u'/'.join(slugifyBit(t) for t in text.split(u'/')) + temp = [] + for t in text.split( u'/' ): + temp.append( slugifyBit( t ) ) + return u'/'.join( temp ) _linkPat = re.compile(ur'^([A-Za-z0-9\s]+:)?([A-Za-z0-9_\.\-\s\/]+)(?:\|([^\n]+?))?\]\](.*)$', re.UNICODE | re.DOTALL) def replaceInternalLinks(text): @@ -1329,8 +1332,8 @@ m = _templateSectionPat.search(headline) if m: istemplate = True - templatetitle = b64decode(m[0]) - templatesection = 1 + int(b64decode(m[1])) + templatetitle = decodestring(m[0]) + templatesection = 1 + int(decodestring(m[1])) headline = _templateSectionPat.sub(u'', headline) if toclevel: EOP python setup.py install
Source
You can check out MediaWikiPluginMacro from here using Subversion, or browse the source with Trac.
Example
{{{ #!mediawiki = Heading = Everything here is interpreted by ''mediawiki'' processor. == List == # first ## first.a ## first.b [Wiki link] }}}
Recent Changes
- 16524 by rjollos on 2017-04-16 01:58:36
-
Fix indentation
- 2483 by permon on 2007-07-18 11:53:41
-
MediaWikiPluginMacro:
backporting - added render_macro
- 2465 by permon on 2007-07-13 15:17:50
-
MediaWikiPluginMacro:
changed default link from '/link' to only 'link' - should work with default trac installation
(more)
Author/Contributors
Author: permon
Contributors: