From OVN wiki
Revision as of 22:23, 26 December 2012 by imported>TiberiusB (→‎Lists)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


HTML::WikiConverter is a Perl module for converting HTML to wiki markup for a variety of different wiki engines. Currently, it supports many dialects:

  • DokuWiki
  • Kwiki
  • MediaWiki
  • MoinMoin
  • Oddmuse
  • PhpWiki
  • PmWiki
  • SnipSnap
  • TikiWiki
  • UseMod
  • WakkaWiki
  • (and others)

I'd really like to add support for TWiki, but the way it handles bold italics (and possibly other nested elements) is very disappointing.


It's very easy to use HTML::WikiConverter. Grab a copy from your favorite CPAN mirror and then run something like this:

  #!/usr/bin/perl -w
  use HTML::WikiConverter;
  my $wc = new HTML::WikiConverter( dialect => 'MediaWiki' );
  print $wc->html2wiki($html);

Alternatively, you might want to try HTML::WikiConverter's command line interface; it's a program called html2wiki and it's stored in bin/html2wiki.

Dialect features

Unfortunately, I haven't managed to implement every feature of each supported dialect. My initial goal was simply to create a converter for MediaWiki (I am a Wikipediholic, after all :-), but then PhpWiki's Reini Urban suggested that I be more ambitious and provide the dialect interface. And so far I've been really happy with the progress.


Of course there are always bugs. Luckily, CPAN comes to the rescue again with its bug tracking service for module authors.

But where would we be without bugs? My Pacman frog sure wouldn't be happy without 'em! Do you know what a Pacman frog is? Or how about an Otago skink? Aplysia californica? Why, these are some of my favorite animals!

My favorite animals
Animal Region Physical traits Food
Pacman frog Gran Chaco (Argentina) Half mouth, half stomach (quite literally!) Crickets, fish, etc.
Otago skink Otago (New Zealand) Black, yellow, and green camouflage Insects, fruits, small lizards
Aplysia california California Deep red-colored sea hare Red and brown seaweed

Common features


Many dialects allow embedded images, either from local or remote stores.

Google logo


Wikis also support lists, even extensively nested ones. Some rely on leading characters to determine nest levels, while others rely on spaces or (egad!) tabs.

  • 1
    • 1a
    • 1b
  • 2
    • 2a
      1. fee
      2. fie
      3. foe
        • fum?

Some wikis support definition lists, though they're often used inappropriately (as in MediaWiki, which uses them for indentation).

Pathologically eclectic rubbish lister
Perl on ecstasy

      • enter text here***