From d368481da4fdff2450ebff93a73303c72838fb6d Mon Sep 17 00:00:00 2001 From: Antoine Durand-Gasselin Date: Wed, 20 May 2009 19:52:24 +0200 Subject: [PATCH] [wiki/macro] Ajout de minipage.py darcs-hash:20090520175224-bd074-0d0c3518360132973674104411c92b847bf2f48d.gz --- wiki/macro/MiniPage.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 wiki/macro/MiniPage.py diff --git a/wiki/macro/MiniPage.py b/wiki/macro/MiniPage.py new file mode 100644 index 00000000..72762fb7 --- /dev/null +++ b/wiki/macro/MiniPage.py @@ -0,0 +1,39 @@ +# -*- coding: iso-8859-1 -*- +""" + MoinMoin - MiniPage Macro + + PURPOSE: + This macro is used to get the possibility to write inside a wiki table normal wiki code. + This code is parsed by the wiki parser and is then displayed. + + CALLING SEQUENCE: + [[MiniPage(wikicode)]] + + INPUTS: + wikicode: e.g. * item1 + EXAMPLE: + ||Buttons ||[[MiniPage( * Redo\n * Undo)]][[MiniPage( * Quit)]]|| + ||Section ||[[MiniPage(= heading 1 =)]][[MiniPage(== heading 2 ==)]]|| + + PROCEDURE: + The \n mark is used for a line break. + + Please remove the Version number from the code! + + MODIFICATION HISTORY: + Version 1.3.3-1 + Version 1.3.3-2 Updated for Moin1.6 + Version 1.6.0-3 refactored + Version 1.7.1-5 refactored for 1.7 + @copyright: 2005-2008 by Reimar Bauer (R.Bauer@fz-juelich.de) + @license: GNU GPL, see COPYING for details. + +""" +from MoinMoin import wikiutil + +def execute(macro, text): + request = macro.request + text = ''.join(text) + text = text.replace('\\n', '\n') + Parser = wikiutil.searchAndImportPlugin(request.cfg, "parser", request.page.pi['format']) + return wikiutil.renderText(request, Parser, text)