[Moin-user] How do you develop/deploy a formatter plugin for a specific MIME type?

Uche Ogbuji uche.ogbuji at gmail.com
Tue May 18 13:43:30 EDT 2010

I'm trying to distribute a non-broken version of the text_xml.py formatter
as a third-party plug-in, but I'm not sure how I register the statement
"please use this formatter instance for requests with mimetype=text/xml".
 Note: I'm willing to instead register for mimetype="application/xml", if
that's easier.

I've read the various pages such as:

 * http://moinmo.in/ApplyingFormatters
 * http://moinmo.in/MoinDev/PluginConcept

They don't really say much about this, except to say "Wiki plugins always
override builtin plugins. For example, if you want to have a different
RecentChanges <http://moinmo.in/RecentChanges> macro, you don't have to
touch MoinMoin <http://moinmo.in/MoinMoin> code, simply write your own
RecentChanges macro and install in the wiki data/plugin/macro/. Your macro
will be used instead of the built-in one."

So I figured I could look at other plugins for a clue, but I don't see any
in the built-ins, and certainly not in text_xml.py, nor in, e.g.
.   The string "mime" appears in neither.

I would have expected FormatterBase initializer to accept a mimetype param,
or for the formatter to call some function to register one or more
mimetypes, but I see nothing of the sort.

I tried to trace it from the other end, i.e. what happens in the show action
when someone requests a specific mimetype, and traced it as far as:


but the trail gets pretty lukewarm at that point and I figured there has to
be something obvious I'm missing.

Any clues, please?


Uche Ogbuji                       http://uche.ogbuji.net
Weblog:                            http://copia.ogbuji.net
Founding Partner, Zepheira        http://zepheira.com
Linked-in: http://www.linkedin.com/in/ucheogbuji
Articles: http://uche.ogbuji.net/tech/publications/
Poetry ed @TNB: http://www.thenervousbreakdown.com/uogbuji/
Friendfeed: http://friendfeed.com/uche
Twitter: http://twitter.com/uogbuji
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/moin-user/attachments/20100518/9af211c4/attachment.html>

More information about the Moin-user mailing list