[[PageOutline(2-5,Contents,pullout)]] = !MediaWiki language processor == Description This plugin introduces a wiki macro `mediawiki`. This macro turns Trac wiki content into pure !MediaWiki: {{{ {{{ #!mediawiki = Heading = Everything here is interpreted by ''mediawiki'' processor. == List == # first ## first.a ## first.b [Wiki link] }}} }}} It is based on this [http://www.djangosnippets.org/snippets/139/ script]. == Bugs/Feature Requests Existing bugs and feature requests for MediaWikiPluginMacro are [report:9?COMPONENT=MediaWikiPluginMacro here]. If you have any issues, create a [/newticket?component=MediaWikiPluginMacro new ticket]. [[TicketQuery(component=MediaWikiPluginMacro&group=type,format=progress)]] == Download Download the zipped source from [export:mediawikipluginmacro here]. == Source You can check out MediaWikiPluginMacro from [/svn/mediawikipluginmacro here] using Subversion, or [source:mediawikipluginmacro browse the source] with Trac. == Installation Execute the following steps: {{{#!sh unzip mediawikipluginmacro.zip cd mediawikipluginmacro ### next step (patch) only for python 2.3 python --version patch -p0 <<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 }}} == Recent Changes [[ChangeLog(mediawikipluginmacro, 3)]] == Author/Contributors '''Author:''' [wiki:permon] [[BR]] '''Maintainer:''' [[Maintainer]] [[BR]] '''Contributors:'''
E-mail address and name can be saved in the Preferences.