=========================================
 MMPP: The MoinMoin Monkey-Patch Package
=========================================

:Author:
  Adrian Perez <adrianperez@udc.es>
:Organization:
  `UDC Free Software Office`_.


About
=====

MMPP is a set of monkey-patches [1]_ for the MoinMoin_ wiki engine. 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"]

.. [1] A patch which is applied as the code runs, without the need of
       modifying the original source code at all.

``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.



Installation
============

Copy this ``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"))


.. _udc free software office: http://softwarelibre.udc.es
.. _restructuredtext: http://docutils.sf.net/rst.html
.. _w3c validator: http://validator.w3.org
.. _moinmoin: http://moinmoin.wikiwikiweb.de

.. vim:ft=rst:spell:spelllang=en:et:
