Mercurial > public > src > moin > extensions
changeset 582:a6e3bc3c144e
macro.MiniPage: renders markup inside other markup, e.g. a bulletlist or headings inside of a table
author | Reimar Bauer <rb.proj AT googlemail DOT com> |
---|---|
date | Fri, 16 Mar 2012 08:43:38 +0100 |
parents | 704cc7c29b9b |
children | 5726458585d7 |
files | data/plugin/macro/MiniPage.py |
diffstat | 1 files changed, 21 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/plugin/macro/MiniPage.py Fri Mar 16 08:43:38 2012 +0100 @@ -0,0 +1,21 @@ +# -*- coding: iso-8859-1 -*- +""" + MoinMoin - MiniPage Macro + + This macro is used to write multi line markup into a table. + Add a linefeed for a new line e.g. + ||Buttons ||[[MiniPage( * Redo\n * Undo)]][[MiniPage( * Quit)]]|| + ||Section ||[[MiniPage(= heading 1 =)]][[MiniPage(== heading 2 ==)]]|| + + @copyright: 2005-2012 by MoinMoin:ReimarBauer + @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) +