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