wiki round tripping (was: Ideas Please)

Jeff Schering jeffschering at gmail.com
Wed May 18 17:02:48 UTC 2005


On 5/17/05, Henrik Nilsen Omma <henrik at canonical.com> wrote:

> Now, how do we do the Moin->DocBook step? I guess a page like this:
> http://test.wiki.ubuntu.com/FrontPage?action=print is a good step in
> that direction. To do it properly we will have to write an export filter
> in python, and then we can put in whatever tags we want. The question
> then will be where to store tags like <author> in the Moin markup? I
> guess we can do it in a comment and then have the python parser fish it out.
> 
> - Henrik
> 

An export filter may be one way to do it. Another way is to use the
rendered html itself. The wiki engine renders the moin into html 4.0
strict. It should be fairly trivial to convert that to xhtml (can
htmltidy do that?) and then from xhtml to DocBook using xslt tools.
This method has the advantage that it is not as dependent on the moin
markup: we won't have to revise the xslt every time a feature is added
to or removed from the ubuntu flavour of moin markup, as it will
always end up in html 4.0 strict.

Another problem is how to convert moin markup such as the bold tags (
''' ). Sometimes ''' means <guibutton>, sometimes <guilabel>, and
sometimes <emphasis role="bold">. One option is to remove the
guibutton and guilabel from the article2moin DTD, and use only the
emphasis tag. Another option is to always convert the ''' to <emphasis
role="bold"> and let some human make any necessary adjustments.
Personally, I prefer the first option.

As an aside, fully automated round-tripping is only possible if there
is no information loss during the conversion from one format to
another. For example, there is an enormous loss of information when
converting the full DocBook with its 300+ descriptive elements to moin
or html, both of which have a handful of markup elements. The only way
to do it successfully is to either use a limited subset of DocBook
(the article2moin approach) or to somehow find a way of embedding that
information in moin comments and then fishing them out during the
moin->DocBook transform. The problem with that approach is that it
becomes so complicated to update the moin by hand that you may as well
just make a DocBook based wiki. Goodbye simplicity.

In any case, I'll have it in the svn repos probably before the
weekend, and also a description of the thing on the test wiki.
Everyone can play with it and make it better.

Cheers,
Jeff

-- 
GPG Key: 1024D/F23C67E8 2005-02-20 Jeff Schering <jeffschering at gmail.com>




More information about the ubuntu-doc mailing list