MoinExportDumpEnhancements
This page is a work in progress. The goal is to collect problems, ideas, examples, and patches that will enhance the functionality of the MoinMoin Export Dump utility to make it into a superior Web Publication application.
A MoinMoin user should be able to dump the entire contents (or subpages) of their personal (or public) wiki to an output directory and upload the contents directly to the free web space provided by their ISP (or other) service. The result should be an attractive, error-free web site.
- I do personally see no big benefit in this features, because
you can easy do this with a simple wget (with the mirroring option and even you can exclude or include "directories") and then upload the full html code (inclusive css, images, javascript, etcetera). this only would require some small script to also upload this via an ftp client to your webserver. if you use some simple cms like theme (without actions, edit function, search stuff, etcetera), you can also ensure that no function will used what a simple html page not can provide.
Or just install MoinMoin on a shared hosting (maybe only with read acls) and synchronisation ( HelpOnSynchronisation ) the whole stuff (Webhosting is possible around $9 per month)
IMHO bye -- MarcelHäfner 2009-04-17 10:12:47
We use Moin as a wiki for various year-long projects. At the end of that year, the project is either finished, with the results going back to the sponsor, or continued for another year, so we want to make the materials available to the next team. Being able to dump the content out into a form that is browsable but doesn't require installation and configuration of Moin is very important for us. -- ClaireConnelly 2009-04-28
Related Pages
HelpOnMoinExportDump -- on the moin 1.7 master wiki.
Known Problems
- No theme support, a very simple hardcoded theme is used.
Hardcoded "theme" has links to FrontPage, TitleIndex, and WordIndex on every page.
- None of the above pages are created when only selected pages are dumped.
Icons are not copied from theme img directory.
- No selection of user language (UI).
show_section_numbers=1 is not supported.
- Hyperlinks on some system pages do not work correctly.
Attachments hyperlinks and show system pages on TitleIndex and WordIndex pages are invalid.
Use a custom template page
-- this was originally contributed by JorgenBodde on the MoinDump page.
When generating sub-pages, moindump is still lacking. This is because the $(navibar)s parameter generates pages that are not generated if you use "--page" as argument. I didn't needed the navibar so I created a small patch where moindump will look in the current output dir for the file moindump.tpl. If the file exists it will load it and replace the page_template with the contents. It might not be the greatest solution, but due to the nature of moindump (being a plugin) it felt wrong to use a global option for only a plugin parameter.
--- C:/Python25/Lib/site-packages/MoinMoin/script/export/dump_org.py Sat Jan 05 03:00:58 2008 +++ C:/Python25/Lib/site-packages/MoinMoin/script/export/dump.py Mon Mar 17 20:56:11 2008 @@ -14,10 +14,11 @@ from MoinMoin.action import AttachFile url_prefix_static = "." logo_html = '<img src="logo.png">' HTML_SUFFIX = ".html" +MOINDUMP_FILE = "moindump.tpl" page_template = u'''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=%(charset)s"> @@ -205,12 +206,33 @@ import traceback traceback.print_exc(None, errlog) finally: timestamp = time.strftime("%Y-%m-%d %H:%M") filepath = os.path.join(outputdir, file) + + # To allow customization of the template, a check is done in the output + # directory for the name 'moindump.tpl' and if this exists it will be taken + # it is not really possible to pass it as argument because the parser + # options are independent of the plugin architecture. + + pt = '' + tplfile = os.path.join(outputdir, MOINDUMP_FILE) + if os.path.exists(tplfile): + f = None + try: + f = open(tplfile, 'rt') + pt = f.read() + except IOError: + pass + if f: + f.close() + + if not pt: + pt = page_template + fileout = codecs.open(filepath, 'w', config.charset) - fileout.write(page_template % { + fileout.write(pt % { 'charset': config.charset, 'pagename': pagename, 'pagehtml': pagehtml, 'logo_html': logo_html, 'navibar_html': navibar_html,
Ideally, the template should be looked for in a separate directory because the outputdir might not exist or is emptied on purpose. It would be great if there is more support for theming and a navigation bar where the user can specify which pages should be displayed in, except the standard (not always generated) pages. I will look into it further, but maybe this helps others too.
Use a custom template file
The patch provides the ability to use a arbitrary template file. The code bases on the patch above. dump_templatefile.diff
Is there a known issue with this patch and 1.8? I always get:
File "/usr/local/lib/python2.5/site-packages/MoinMoin/script/export/dump.py", line 224 else: ^ IndentationError: unexpected indent
The patch is obviously invalid. Maybe you can get it working be indenting it correctly. Otherwise contact its author, please.
The patch was broken. It's repaired now and tested on MoinMoin 1.7.3 successfully. The old version is stored as dump_templatefile_broken.diff for reference pruposes only. -- CarstenGrohmann 2009-04-17 08:42:22