html To Moin

First From Docbook To Html

Some html LDP page are old and may have been generated from old docbook toolchain. Some may be good, but unusefully complex html and may require update before converting to wiki.

You should install and use the:

docbook2html -v              
DocBook-utils version 0.6.14 (jw version 1.1)               

Library version.

And use is:

docbook2html -u input.xml

The input.html file is created.

Perl

This one http://search.cpan.org/dist/HTML-WikiConverter/ works pretty well (compiled as root) - Is installed in /usr/lib/perl5/site_perl/5.10.0/HTML/WikiConverter, where one can find the file MoinMoin.pm including the translation template (replace there [[BR]] with <<BR>>).

In fact, you can directly run perl -MCPAN -e 'install Bundle::HTMLWikiConverter', but it's probably best to dowload from CPAN and read the INSTALL file, just in case something changed.

To make the convert, uses:

html2wiki --dialect MoinMoin input.html > output.moin

And copy/paste the result on a Moin page. You still have to remove the unusefull table of content and replace it with <<TableOfContents>>.

The result is far from perfect, but usable. Identified problems are images insert and some html entities conversion.

Online Perl

One have also to replace [[BR]] by `
. These changes can easily be done in an external text editor and the document then pasted.

Php

The php file works online, on the given link (http://yansanmo.no-ip.org/outil/wiki/html2moinmoin.php). Try <h1>test </h1>

Txt to Moin

Text to Html

You may have only a text document. One solution is to convert it first to html.

tx2tags

Text2tags do a very bad job as translating from text to moin, essentially do nothing but inserting brackets before and after the hole text. But it does a reasonable job as translating to html. So is the only version of the document you have is text, you can first translate to html with txt2tags then to Moin with the perl script html2wiki.

txt2html

There is a perl script http://txt2html.sourceforge.net/ that do a reasonable job.

Moin GUI conversion

If you use the graphical user interface (GUI) editor, you have an icon "Paste as plain text" that inserts lot of <<BR>> to make the text readable. This is not a real conversion.

By Hand

One can use the txt version of the HOWTO. This needs some editing by hand.

A working system is to enclose the hole txt part in {{{ }}} triple brakets to have them displayed "raw" and move the brackets along with the editing process. Pasting in the GUI editor do exactly that.

Using OpenOffice.org

http://www.ooowiki.de/Writer2MoinMoin

Allows using OpenOffice writer as MoinMoin file generator. It's possible to open an html file (probably better than a text file), execute the MoinMoin macro (among all the Writer2MoinMoin macros) and have a new window open with pretty good Moin markups.

The macro is not completely finished, I got an error, but the result is quite good and may be one should use smaller html files convert by parts). Of cource one can also write with OpenOffice from the beginning.

Converters (last edited 2009-02-18 07:22:48 by jdd)