1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
|
<html>
<head>
<title>Complete example</title>
<script type="text/javascript"><!--
function doSomething() { alert('hello!'); }
//--></script>
<style type="text/css">
body { font-size: 12pt; background:#ccc }
h1, h2, h3 { font-family: verdana, sans-serif }
</style>
</head>
<body>
<h1>HTML::WikiConverter</h1>
<p>HTML::WikiConverter is a Perl module for converting HTML to wiki
markup for a variety of different wiki engines. Currently, it supports
<b>many</b> dialects:</p>
<ul>
<li>DokuWiki
<li>Kwiki
<li>MediaWiki
<li>MoinMoin
<li>Oddmuse
<li>PhpWiki
<li>PmWiki
<li>SnipSnap
<li>TikiWiki
<li>UseMod
<li>WakkaWiki
<li>(and others)
</ul>
<p>I'd <em>really</em> like to add support for TWiki, but the way it
handles <em><strong>bold italics</strong></em> (and possibly other
nested elements) is very disappointing.</p>
<h2>Installation</h2>
<p>It's very easy to use HTML::WikiConverter. Grab a copy from your
favorite <a href="http://www.cpan.org">CPAN mirror</a> and then run
something like this:</p>
<pre> #!/usr/bin/perl -w
use HTML::WikiConverter;
my $wc = new HTML::WikiConverter( dialect => 'MediaWiki' );
print $wc->html2wiki($html);</pre>
<hr />
<p>Alternatively, you might want to try HTML::WikiConverter's command
line interface; it's a program called <code>html2wiki</code> and it's
stored in <i>bin/html2wiki</i>.</p>
<h2>Dialect features</h2>
<p>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.</p>
<h2>Bugs</h2>
<p>Of course there are always bugs. Luckily, CPAN comes to the rescue
again with its <a href="http://rt.cpan.org">bug tracking service</a>
for module authors.</p>
<p>But where would we be without bugs? My Pacman frog sure wouldn't
be happy without 'em! Do you know what a <a
href="http://en.wikipedia.org/wiki/Pacman_frog">Pacman frog</a> is?
Or how about an Otago skink? Aplysia californica? Why, these are some
of my favorite animals!</p>
<table>
<caption>My favorite animals</caption>
<tr>
<th>Animal</th>
<th>Region</th>
<th>Physical traits</th>
<th>Food</th>
</tr>
<tr>
<td>Pacman frog</td>
<td>Gran Chaco (Argentina)</td>
<td>Half mouth, half stomach (quite literally!)</td>
<td>Crickets, fish, etc.</td>
</tr>
<tr>
<td>Otago skink</td>
<td>Otago (New Zealand)</td>
<td>Black, yellow, and green camouflage</td>
<td>Insects, fruits, small lizards</td>
</tr>
<tr>
<td>Aplysia california</td>
<td>California</td>
<td>Deep red-colored sea hare</td>
<td>Red and brown seaweed</td>
</tr>
</table>
<h2>Common features</h2>
<h3>Images</h3>
<p>Many dialects allow embedded images, either from local or remote
stores.</p>
<p><img src="http://www.google.com/images/logo.gif" alt="Google logo" /></p>
<h3>Lists</h3>
<p>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.</p>
<ul>
<li>1
<ul>
<li>1a</li>
<li>1b</li>
</ul>
</li>
<li>2
<ul>
<li>2a
<ol>
<li>fee</li>
<li>fie</li>
<li>foe
<ul>
<li>fum?
</ul>
</li>
</ol>
</li>
</ul>
</li>
</ul>
<p>Some wikis support definition lists, though they're often used
inappropriately (as in MediaWiki, which uses them for
indentation).</p>
<dl>
<dt>Perl</dt>
<dd>Pathologically eclectic rubbish lister</dd>
<dt>POE</dt>
<dd>Perl on ecstasy</dd>
</dl>
</body>
</html>
|