MoinMoin OpenDocument Formatter
General
This formatter creates an OpenDocumentText (.odt) file from a MoinMoin page. OpenDocument is the standard file format for OpenOffice.org and KOffice and can be imported by many other applications. Furthermore, by converting the output file with OpenOffice.org you can easily create MS Word or PDF files.
After installing (please read file INSTALL.txt) you should see a new entry in your MoinMoin action menu: "Render As OpenDocument".
Version information (0.9, April 2010)
MoinMoin2ODF 0.9 is the current version, tested with MoinMoin 1.9. I'm planning to do a more feature complete version (ToC links are still missing). However since I haven't the time at the moment I wanted to release at least something working for MoinMoin 1.9.
Version information (0.8, May 2009)
MoinMoin2ODF 0.8 is the newest version, tested with MoinMoin 1.7 and 1.8. If you run older MoinMoin versions, you might be interested in MoinMoin2ODF 0.6 (tested with MoinMoin 1.6) or MoinMoin2ODF 0.5 (tested with MoinMoin 1.5).
They all can export most MoinMoin tags to OpenDocument format, including tables, lists and images. The differences are: Since 0.7 MoinMoin2ODF now properly escapes URLs, so that Weblinks like "http://foo.bar?a=1&b=2" work. Since MoinMoin2ODF 0.8 the Include macro works.
You'll find installation help in file INSTALL.txt for the following target systems:
System |
Installation Help / section |
MoinMoin on Linux |
INSTALL.txt / Automatic Install |
MoinMoin on Windows XP |
INSTALL.txt / Automatic Install |
MoinMoin Packages from Linux Distribution |
INSTALL.txt / Manual Linux Install |
MoinMoin DesktopEdition |
INSTALL.txt / Manual Install for MoinMoin DesktopEdition |
Known Issues:
Images have no explicit size attribute in generated documents. That's because this plugin neither knows the dimension of attachment images nor the available space in the OpenDocument paper sheet. Therefore images are given a (usually tiny and non proportional) default size depending on the word processor (for example Openoffice.org Writer or Kword). You have to resize the images manually in your word processor. For the future I'll search for a more convenient solution.
KWord 1.6 has some problems displaying correct list indentations. This is no problem of this formatter but a problem KWord has with documents generated by OpenOffice.org, too.
User Feedback for MoinMoin2ODF 0.7 - 0.9
It would be nice if you could provide me with some feedback here. Thanks a lot!
Thank you. Runs fine with MoinMoin 1.8 here -- CarstenLemmen 2008-12-18 10:30:22
seems not to work with the <<Include()>> macro => BUG? -- CarstenLemmen 2009-03-09 12:14:20
seems not to work with the #!html -parser => BUG? -- MelaEckenfels 2009-05-22 23:49:31
You mean that html-parser content is omitted? As I just checked with MoinMoin 1.7 the html parser either sends raw HTML (which a non-HTML formatter cannot handle) or plain preformatted text. But this text is not wrapped in paragraphs and that's why I treat it as invalid content. I will try to handle this special case in one of the next versions, however I can't promise that it will look nice as it's just preformatted text. As the developer of a non-HTML formatter I consider the common usage of raw HTML output (in parsers, macros, HTML/CSS table formatting) as one of MoinMoin's biggest drawbacks. Please don't depend on HTML! -- Hans-Peter
Successfully used with MoinMoin 1.8, support for TOC (interlinks) would be beautiful!
Successfully used with MoinMoin 1.9 with a little patch
Replace in RenderAsOpenDocument.py:
request.emit_http_headers([ 'Content-Type: application/vnd.oasis.opendocument.text', 'Content-Disposition: attachment; filename="%s"' % (filenameASCII) ])
- With:
request.headers.add('Content-Type','application/vnd.oasis.opendocument.text') request.headers.add('Content-Disposition: attachment','filename="%s"' % (filenameASCII))
- Note: This patch is meant for MoinMoin2ODF 0.8. Version 0.9 should work without problems.
Great Plugin! FrankSlotta
Very useful, thanks a lot! -- FrBrGeorge 2010-09-10 06:34:45
0.9 seems still not to work with <<Include()>> at 1.9.3 -- FrBrGeorge 2010-09-10 06:34:45
0.9 seems not to work with {{{ blocks (joins lines) at 1.9.3, this is very annoing for verbatim breaks, at 1.9.3 -- FrBrGeorge 2010-09-10 06:34:45
- Would be great if you could embed icons too. I often use e.g. the checkmark.
Thanks - with the attached modification it will load images sourced from other pages modified_attachment_image.py -- IanRiley 2012-01-02 06:52:08
User Feedback for MoinMoin2ODF 0.1 - 0.6
Hi Hans Peter Schaal,
thanks for working on this formatter. I guess many people will be interested in a formatter for OOo. While I don't have a 1.5 testwiki here I can't try out. It would be nice to have a version for 1.6 too. Some comments about the code.
- please use the MoinMoin/_template.py (for the action too)
- some PEP8 issues (mostly blanks on wrong places or missing blanks, sometimes parentheses)
- some parts of the code I guess will be beautified in further versions.
may be you can use a form similiar to the CreatePdfDocument by RaphaelBossek later on (may be you both could use the same form?)
cheers -- ReimarBauer 2008-02-23 22:28:57
Hi Hans-Peter, many thanks for this converter!! Cheers!
Debian developer speaking: do NOT do as documented in INSTALL.txt for Debian packages. It is incredibly complicated and puts you at risk of breaking your system. Simply ship the plugins with your MoinMoin instance, or directly in /usr/local/lib/python2.X/MoinMoin/. I also noticed some other issues:
- Images inserted as external links do not work. This is expected since they are only available from the client side, but it’s quite a shame.
The href field in hyperlinks is not properly escaped. This leads to a failure to open the document when a hyperlink contains a ; or a &.
It is still not bundled with MoinMoin, despite being quite important functionality
I tried your advice and copied the MoinMoin subdirectory to /usr/local/lib/python.../ or /usr/local/lib/python.../site_packages/ but didn't succeed.
However I think your first hint is just the solution: If automatic install doesn't work, just ship both files with your MoinMoin instance. While this may be a bit costly for users with multiple wiki instances I guess that such advanced users install the original MoinMoin packages.
Hans-Peter
Note from moin2 development:
I think we could do opendocument <-> wiki markup much better and easier in moin2, but there is no real converter yet.
It is easier now to write one, as we have a "moin DOM tree" as intermediate format now, so you only need to convert opendocument to/from DOM, not to/from any other markup.
What we have already is a very simple opendocument to text/plain converter that can be used for search indexing, but it just unpacking and throwing the tags away, so not usable for anything else than indexing.
If someone is interested in working on this, join us on MoinMoinChat.
-- ThomasWaldmann 2012-01-04 16:55:16
hi, thanks for this formatter. Unfortunately it doesn't work with my installation (MoinMoin 1.9.8 with Apache 2.4 @ Debian Jessie). Webserver log files:
mod_wsgi (pid=6596): Exception occurred processing WSGI script '/usr/share/moin/server/moin.wsgi'. Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 588, in __call__ return self.app(environ, start_response) File "/usr/lib/python2.7/dist-packages/MoinMoin/wsgiapp.py", line 285, in __call__ return response(environ, start_response) File "/usr/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 1207, in __call__ start_response(status, headers) ValueError: space character present in header name
Any hint how to solve this? Thanks!