#!/usr/bin/perl
# mediawiki2html - converts MediaWiki markup into HTML markusp
# Copyright (C) 2006 Gervase Markham
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# This software was written to the Glory of God.
use lib ".";
use CGI qw(:standard);
use Text::MediawikiFormat;
# Self-download code
if (param('downloadself')) {
seek(DATA, 0, SEEK_SET);
print "Content-Type: text/plain\n\n", ;
exit(0);
}
# Print header
print < MediaWiki2HTML does exactly what it says on the tin.
If you have no MediaWiki markup and want to try it out, you can find some
by clicking the Edit link on any article on
Wikipedia.
MediaWiki2HTML
$text
And it will look like this:
$decoded EOF } print <The code for this application is available under the terms of the GNU General Public Licence. It's basically a web interface to the excellent Text::MediawikiFormat module.