[Moin-user] How can a macro output a wikitext together with another macro...

Mail@Heavy.ch mail at heavy.ch
Wed Apr 1 18:22:30 EDT 2009


hi there

I made some small macro like:
<<Licence(type="article",source="wikipedia",item="MoinMoin")>>

with should output some FootNote Macro with prefilled automatic
generated footnote text/links, well see here for an example

http://rock.heavy.ch/Test

The problem is that the macro "FootNote" is not getting
rendered/executed. How I can do this?

My source looks like this (in short):
********************************************
from MoinMoin.parser.text_moin_wiki import Parser as WikiParser
    request = macro.request
    formatter = macro.formatter
            wikitext = u'''
             <<FootNote(
             Diese Wikiseite basiert auf dem Artikel
[[%(urlWikipedia)s/%(item)s|%(item)s]]
             aus der freien Enzyklopädie Wikipedia und steht unter
der [[%(urlGFDL)s|GFDL]]
             In der Wikipedia ist eine Liste der
[[%(urlWikipediaAuthor)s/index.php?title=%(item)s&action=history|Autoren]]
verfügbar.
             )>>
        ''' % {
            "item": item,
            "urlWikipedia" : urlWikipedia,
            "urlGFDL" : urlGFDL,
            "urlWikipediaAuthor" : urlWikipediaAuthor,
        }
    wikitext = wikiutil.escape(wikitext)
    WikiParser(wikitext,request).format(request.formatter)
********************************************

The output as a normal wiki text works but if you use some @PAGE@, <!>
or even another Macro it's not working.

Is there an example how I can call from a macro another marco and
parse/render this? I was looking in other macros and in the source of
moinmoin but couldn't find any examples how to do this. Any hints? :-)))

Btw. I tried first to directly return the text with a formatter but I
was only able to this with text or rawHTML and not moin wiki text. Did I
miss something?

--> Or would it better to do make this stuff with a parser like
{{{#!License type=article,source=wikipedia,item=MoinMoin
}}}

bye
Marcel

p.s.
sended this already with the wrong from e-mail adress, so this is the
right one, the other can be deleted.






More information about the Moin-user mailing list