00001
00002 """
00003 MoinMoin - MiniPage Macro
00004
00005 PURPOSE:
00006 This macro is used to get the possibility to write inside a wiki table normal wiki code.
00007 This code is parsed by the wiki parser and is then displayed.
00008
00009 CALLING SEQUENCE:
00010 [[MiniPage(wikicode)]]
00011
00012 INPUTS:
00013 wikicode: e.g. * item1
00014 EXAMPLE:
00015 ||Buttons ||[[MiniPage( * Redo\n * Undo)]][[MiniPage( * Quit)]]||
00016 ||Section ||[[MiniPage(= heading 1 =)]][[MiniPage(== heading 2 ==)]]||
00017
00018 PROCEDURE:
00019 The \n mark is used for a line break.
00020
00021 Please remove the Version number from the code!
00022
00023 MODIFICATION HISTORY:
00024 Version 1.3.3.-1
00025 Version 1.3.3.-2 Updated for Moin1.6
00026 @copyright: 2007 by Reimar Bauer (R.Bauer@fz-juelich.de)
00027 @license: GNU GPL, see COPYING for details.
00028
00029 """
00030 from MoinMoin.parser import text_moin_wiki as wiki
00031
00032 import string, StringIO
00033
00034 def execute(macro, text):
00035 text=string.replace(string.join(text, ''), '\\n', '\n')
00036
00037 out=StringIO.StringIO()
00038 macro.request.redirect(out)
00039 wikiizer = wiki.Parser(text, macro.request)
00040 wikiizer.format(macro.formatter)
00041 result=out.getvalue()
00042 macro.request.redirect()
00043 del out
00044 return(result)