MMPP

MMPP is a set of monkey-patches (patches which are applied as the code runs, without the need of modifying the original source code at all). Those patches are installed into the MoinMoin instance at http://softwarelibre.udc.es without known problems.

The available patches are the following, each one into its own module:

html4
Fixes some HTML generation code so content validates properly against the W3C Validator. This affects (mainly) the generation of unique "id" attributes and the reStructuredText translator. This patch needs no configuration.
i18n

Adds poor man's internationalization support to MoinMoin. This means that when accessing a particular page, the user-preferred language will be prepended (e.g. /FrontPage becomes /en/FrontPage when the browser sends en in the Accept-Language HTTP headers), if the localized page is not found, the original (namely /FrontPage) is returned. You can restrict the list of languages which will be tried by adding the available_languages attribute to your configuration. As en example the following restricts localized page searches to English, Spanish and Japanese:

  •     available_languages = ["en", "es", "ja"]
rstmacro

Adds an interpreted text role to the reStructuredText_ parser named macro which allows for inline expansion of wiki macros, in the following fashion:

  •     The following :macro:`MacroName(arg1, arg2)` is expanded inline.

Be careful that the implementation uses the threading module which ships with Python. If your operating system has a flaky or an unsupported threads model, race conditions may arise due usage of thread-local storage for passing the current parser to the implementation of the interpreted text role.

Download

Installation

Copy the mmpp directory somewhere into your Python PATH. The directory where your wikiconfig.py resides is a good candidate. After that edit your wikiconfig.py and add those lines to the end:

  import mmpp
  mmpp.wire()

This will apply all the available patches. If you only want a subset of patches applied, you can change the last line:

  import mmpp
  mmpp.wire(patch="i18n")

Or, of you want to specify more than one patch:

  import mmpp
  mmpp.wire(patches=("i18n", "html4"))

Authors

MoinMoin: MonkeyPatchPackage (last edited 2007-10-29 19:09:19 by localhost)