I've been trying to fix MoinMoin's text_plain formatter to produce readable output. It's almost correct, except I don't understand why I can't get the LF-adding rules correct. Either there are too many LFs or too few. And whenever I change something, something else breaks.. It's getting pretty annoying.
So if anyone else wants to try getting it fixed that'd be great. :) Attached the current version that I have.
For testing you'll need your own MoinMoin installation. Then replace the included text_plain.py with the attached version. Then test it with for example:
http://localhost/wiki/SomePage?action=format;mimetype=text/plain
On Thu, 2007-03-15 at 02:19 +0200, Timo Sirainen wrote:
I've been trying to fix MoinMoin's text_plain formatter to produce readable output. It's almost correct, except I don't understand why I can't get the LF-adding rules correct. Either there are too many LFs or too few. And whenever I change something, something else breaks.. It's getting pretty annoying.
Well, rewriting the line handling rules fixed it. If someone wants to look at the new version, it's at http://dovecot.org/tmp/text_plain.py
I think the output is pretty good now. You can get the whole wiki as .txt from http://dovecot.org/tmp/wiki-export.tar.gz
Comments? Do you find any bugs? There used to be for example missing spaces, but those should be fixed now.
Each file begins with page name and a fixed number of '=' characters. Looks like that can't be changed with text_plain.py. I'll anyway change that to something better later.
I thought I'd change the Foo/Bar wiki links to Foo.Bar. That way there can exist both "Foo" and "Foo.Bar", which wouldn't be possible with '/' separator. The filenames would also be changed.
I'm not sure if the files should end with .txt or not. And if they do, should the .txt be added to wiki links?
I think the wiki pages should go to doc/wiki/ directory. Otherwise the example configuration files get lost within all the files.
The example configs currently link to web wiki pages. Should those be changed to doc/wiki/PageName.txt? Probably not, because the web pages might have newer information.
On Fri, 2007-03-16 at 06:48 +0200, Timo Sirainen wrote:
Well, rewriting the line handling rules fixed it. If someone wants to look at the new version, it's at http://dovecot.org/tmp/text_plain.py
Neat :)
I think the output is pretty good now. You can get the whole wiki as .txt from http://dovecot.org/tmp/wiki-export.tar.gz
Comments? Do you find any bugs? There used to be for example missing spaces, but those should be fixed now.
I'll look a bit more when I'm back from vacation.
Each file begins with page name and a fixed number of '=' characters. Looks like that can't be changed with text_plain.py. I'll anyway change that to something better later.
IIRC that's part of the plain exporter script I sent you, you might want to check there.
The example configs currently link to web wiki pages. Should those be changed to doc/wiki/PageName.txt? Probably not, because the web pages might have newer information.
I think we talked about that a while ago, having it point to the wiki snapshot would guarantee that the documentation applies to that exact version when changes are made. And you can still find the wiki page easily.
johannes
On Fri, 2007-03-16 at 06:48 +0200, Timo Sirainen wrote:
I think the output is pretty good now. You can get the whole wiki as .txt from http://dovecot.org/tmp/wiki-export.tar.gz
Updated. It contains now only the files I meant to be in there. Although I was thinking about creating a special FrontPage. Especially because I removed all the "Examples / scenarios" pages.
Any comments about that? Would it otherwise be ok to exist in doc/wiki/? Are there any pages that should be removed, or something that I shouldn't have removed?
I thought I'd change the Foo/Bar wiki links to Foo.Bar. That way there can exist both "Foo" and "Foo.Bar", which wouldn't be possible with '/' separator. The filenames would also be changed.
Did that.
I'm not sure if the files should end with .txt or not. And if they do, should the .txt be added to wiki links?
Did both.
Please include AS MUCH AS examples/scenarios as you can!!! My experience as newby is that those 'real world configs' are very important to get the grip of things.
It does not matter where they are (wiki or ../doc) as long as they are accessable somewhere.
Thanks!
Egbert Jan NL
-----Original Message----- From: dovecot-bounces@dovecot.org [mailto:dovecot-bounces@dovecot.org] On Behalf Of Timo Sirainen Sent: Friday, March 16, 2007 6:39 PM To: Dovecot Mailing List Subject: Re: [Dovecot] wiki -> txt
On Fri, 2007-03-16 at 06:48 +0200, Timo Sirainen wrote:
I think the output is pretty good now. You can get the whole wiki as .txt from http://dovecot.org/tmp/wiki-export.tar.gz
Updated. It contains now only the files I meant to be in there. Although I was thinking about creating a special FrontPage. Especially because I removed all the "Examples / scenarios" pages.
Any comments about that? Would it otherwise be ok to exist in doc/wiki/? Are there any pages that should be removed, or something that I shouldn't have removed?
I thought I'd change the Foo/Bar wiki links to Foo.Bar. That way there can exist both "Foo" and "Foo.Bar", which wouldn't be possible with '/' separator. The filenames would also be changed.
Did that.
I'm not sure if the files should end with .txt or not. And if they do, should the .txt be added to wiki links?
Did both.
On Fri, 2007-03-16 at 18:57 +0100, Egbert Jan wrote:
Please include AS MUCH AS examples/scenarios as you can!!! My experience as newby is that those 'real world configs' are very important to get the grip of things.
It does not matter where they are (wiki or ../doc) as long as they are accessable somewhere.
Sure they'll stay in wiki, and I'll also add a link in the doc/FrontPage.txt to them, but I don't think they'll do much good inside doc/*.txt, especially because some of them are pretty big so they'll waste space in the tarball.
participants (3)
-
Egbert Jan
-
Johannes Berg
-
Timo Sirainen