So I finally started building a script that does it. Anyone interested in helping with it so that it produces readable output?
First step is getting raw wiki pages. I'll do this directly by getting them from the filesystem. You can get them from here: http://dovecot.org/tmp/wikipages.tar.gz
Next there's http://dovecot.org/tmp/wiki2txt.pl which is my horrible Perl script that kind of works now to produce almost readable text files. Its current output is in http://dovecot.org/tmp/wikitxt.tar.gz
One thing I'm wondering about is how to make the directory layout work. For example there is "UserDatabase" and "UserDatabase/Static" pages. Currently I'm placing the latter into "_UserDatabase/Static" but I don't think that's the best solution.
I was thinking about adding some "include" and "exclude" lists. If a page is in excluce list it's skipped. If it's in neither list it prints a warning but still includes it. So this makes it easy to find out the new pages and figure out if they should be included in the documentation.