Experimental project

This is a sandbox project, which contains experimental code for developer use only.

The MediaWiki Filter module (aka mediawiki_filter) provides an input format, compatible with MediaWiki markup. Opposed to older approaches, it does not emulate the MediaWiki parser, but wraps the original MediaWiki's library for parsing and rendering MediaWiki syntax.

Built-in features (no additional modules required):

  • 100% compatibility with MediaWiki markup;
  • Table support;
  • Distinction between internal and external links;
  • ToC. Table of content support;
  • Templates. A content type can be defined as Template. Usage: {{Name}}
  • Interwiki links are supported and can be specified by providing a mapping of interwiki targets and mapping URLs. A special interwiki target is given for linking to a drupal path.

Module status: To gain full project status, this sandbox project has been submitted to the Drupal.org Project applications queue on September 1, 2011.

The filter supports image links with images uploaded through the image module to some degree. Just use the name of an image node in the image name of the wiki syntax and it links to this image. However, targeting image derivates is not working well. Alternatively the Image filter module can be used which supports CCK ImageFields as well.

There is also some degree of integration with other contributed modules:

More useful additions:

This module can be used as a plug-in-replacement for MediaWiki component of the legacy PEAR Wiki Filter.

Overview on implemented features and limitations of the parser: in German, in Englisch.

Quick installation instructions

The module is currently available via Git from Drupal.org. Full integration into the 'update status' mechanism is planned.

This will give you mediawiki_filter folder. Put that, as usual, in ./sites/all/modules, and enable the module. Then create an input filter like "MediaWiki" and enable the mediawiki_filter module for that input format.

Note: MediaWiki Filter emits HTML code. As such, you must pay attention when combining this module with other filters that generate or modify HTML code. In particular, you should disable Drupal's build-in HTML filter and HTML corrector.

If you are using additions filter like 'GeSHi filter' and/or 'Image filter', you might have to sort the filter chain. This configuration has been tested:

  -10  Mediawiki filter
    0  GeSHi filter
    5  Image filter

If you are migrating from PEAR Wiki Filter, just replace this filter with mediawiki_filter.

Development Guidelines

  • No commit without corresponding issue

    All commits to the repository must reference a corresponding issue. This helps tracking changes, and prevents accidental changes and regression errors.

    Ideally, the workflow is as follows:

    1. Have an idea
    2. Open an issue (feature request/bug report)
    3. Take an issue (i.e. assign it to you)
    4. Work on the issue
    5. Commit it & push to the repository
    6. Update/close the issue

    Always write the issue number into the commit message, and when updating the issue, reference the commit (by its hash).

  • Write a meaningful commit message

    At the bare minimum, follow the guidelines demanded by Drupal, see Commit messages. Do not hesitate to write even more extensive commit messages.

  • Only one issue per commit

    Do not commit code that target multiple issues at the same time. If necessary, use Git's feature to only commit partial files if necessary.

  • Git branches

    Drupal outlines some rules about properly naming Git branches. While we are free to name local branches as we want to (e.g. when adding a new feature), everything that is released through drupal.org must use Drupal's naming scheme (see Release branches).

    Contrary to Git conventions, this means that the master branch is not used, but the main development stream is on a branch called 6.x-1.x (for a D6 release).

  • Format your code

    Use the Coder module to periodically check the modules code against Drupal guidelines.

    Note that due to the nature of this module (and its usage of a 3rd party library), some of the Drupal guidelines have to be broken. For instance, we have to use different variable names that integrate with Mediawiki (which are in CamelCase) that don't follow the Drupal conventions (which use underscores).

  • Write in English

    Drupal and its modules live in an international community. Keeping all aspects of the module in English helps integrating it. Therefore you should always English words in the code (variables, comments, etc), the documentation pages, issue reports, and so on.

These rules above are not absolute. You may break them if necessary, but if you do so, be sure to properly and extensively document your actions (e.g. by an extended commit message, a large comment in an issue, etc).

Credits and additional resources

Background: Origo project, #554150: Status of mediawiki_filter

As always, this module is standing on the shoulders of giants: Credits for mediawiki_filter and the MediaWiki software. The original authors of the mediawiki_filter module are rötzi and bherlig.

Project information

  • caution Seeking co-maintainer(s)
    Maintainers are looking for help reviewing issues.
  • Created by asb on , updated