++ed by:

2 PAUSE users
2 non-PAUSE users.

Author image David Iberri


HTML::WikiConverter - An HTML-to-wiki markup converter


  my $wc = new HTML::WikiConverter(
    html => $html

  print $wc->output, "\n";


There are lots of programs out there that convert wiki markup into HTML, but relatively few that convert HTML into wiki markup. HTML::WikiConverter falls into the latter category, converting HTML source into wiki markup. The resulting markup is suitable for most wiki engines, but is admittedly targeted for MediaWiki (on which Wikipedia runs -- see http://wikipedia.org)


  $wc = new HTML::WikiConverter( %attribs )

Accepts a list of attribute name/value pairs and returns a new HTML::WikiConverter object. Allowed attribute names:

 file     - (scalar) name of HTML file to convert to wikitext
 html     - (scalar) HTML source to convert
 base_url - (scalar) base URL used to make absolute URLs
 dialect  - (scalar) wiki engine target, either MediaWiki
                     or PhpWiki (default: MediaWiki)

If both the 'file' and 'html' attributes are specified, only the 'file' attribute will be used.

  $file = $wc->file

Returns the value of the 'file' property passed to the new constructor.

  $html = $wc->html

Returns the value of the 'html' property passed to the new constructor.

  $root = $wc->root

Returns the root HTML::Element of the HTML tree

  $output = $wc->output

Converts HTML input to wiki markup.

  $log_output = $wc->log

Returns log information accumulated during conversion.

  $html = $wc->rendered_html

Returns a pretty-printed version of the HTML that WikiConverter used to produce wikitext markup. This will almost certainly differ from the HTML input provided to new because of internal processing done by HTML::TreeBuilder, namely that all start tags are closed, HTML, BODY, and HEAD tags are automatically wrapped around the provided HTML source (if not already present), tags are converted to lowercase, attributes are quoted, etc.


Copyright (c) 2004 David J. Iberri

This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself.


David J. Iberri <diberri@yahoo.com>

1 POD Error

The following errors were encountered while parsing the POD:

Around line 283:

You forgot a '=back' before '=head1'