view data/plugin/macro/ @ 511:ef1f74bf4776

macro DictColumns: new keyword markup defined (default is "definition list"). By setting it to "title" the column headings are defined by the titles of the pageThe text below a title becomes assigned to the column.
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Fri, 19 Mar 2010 22:59:00 +0100
parents f57de7994cf6
children 127da830be6c
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    MoinMoin - mathtran

    This macro is used to call the mathtran parser,
    it is just a thin wrapper around it.

    @copyright: 2008-2009 by MoinMoin:ReimarBauer
    @license: GNU GPL, see COPYING for details.

from MoinMoin import wikiutil

class mathtran:
    def __init__(self, macro, args):
        self.macro = macro
        self.formatter = macro.formatter
        self.args = args

    def renderInPage(self):
        mathtran_parser = wikiutil.importPlugin(self.macro.cfg, 'parser', 'text_x_mathtran', 'Parser')
        if mathtran_parser is None:
            return self.formatter.text("Please install the mathtran parser!")

        ap = mathtran_parser(self.args, self.macro.request)
        if ap.init_settings:
            return ap.render(self.formatter)

def execute(macro, args):
    return mathtran(macro, args).renderInPage()