Aus Free Software
Version vom 14. November 2014, 20:05 Uhr von Mati (Diskussion | Beiträge)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen
Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png

Release status: stable

Implementation Special page
Description This extensions converts a MediaWiki to raw HTML ready for a drupal-installation.
Author(s) Mathias Ertl (Mati talk)
Version 1.0.4 (2010-08-07)
MediaWiki 1.11.1+
License GPL v3 or any later version.
Download see Download
Example Convert this page
Hooks used


ToHTML converts a MediaWiki page to HTML and prints the HTML in <pre></pre>-tags. This extension was written out of the desire to be able to write pages on a MediaWiki and then automatically convert them into a form that is ready for use in Drupal.

The HTML is specially manipulated to fit our needs, if you want to use the extension, you will have to modify it. It converts relative Wiki-URLs to absolute URLs (e.g. /wiki/ToHTML to and links to are made relative.


The source code of this extension is managed on GitHub. You can find the repository at mathiasertl/MediaWikiToHTML. To get the most recent version of this extension, fetch the current HEAD:

git clone ToHTML

Older versions are marked as tags, you can view available tags with git tag -l and move back to the current HEAD with git checkout <tag-name>. Versions for older versions of MediaWiki, if available, are managed as branches, use git branch and git checkout <branch> to move to a specific branch. To move back to the newest version, use git checkout master.

Note that GitHub allows you to download older different commits as tarball if you do not want to install git.

Installation & Configuration

Simply download the extension into your extensions-directory and do a require_once in LocalSettings.php:

require_once( "$IP/extensions/ToHTML/ToHTML.php" );

After that, you can convert any page to HTML simply by giving it as a parameter to Special:ToHTML, like so:

Example is a MediaWiki-page. This page was converted using this extension (see red banner on top), and the HTML was copy+pasted into Note that the red banner in the wiki-page will be automatically cut, and the three links directly below the banner will be expanded to the nice header and footer pointing to the next and previous page.


1.0.4 (rev. 336)
  • Removed special parsing for the block-header and footer, this is now done by a Drupal extension.
  • [[File:... links to directly point to VoWi
  • Updated homepage link to this page
1.0.3 (rev. 320)
  • Added action=raw HTML parameter.
  • This version was tested with MediaWiki 1.15.1
1.0.2 (rev. 221)
  • Updated translation to work in all wiki/user language combinations
  • removed $wgToHTMLenable, nobody needs this.
1.0.1 (rev. 197)
  • Updated to work with MediaWiki 1.11.1 and later by fixing LanguageGetSpecialPageAliases (This was a typo in 1.11.0, see Bug 11462)
  • Updated link to this page (This wiki now uses Very short URLs)
  • First version documented here


GPL v3 or any later version.