Contents
Introduction
That's the editmoin web page. This program allows you to edit Moin pages with your preferred editor. It means you can easily edit your pages, without the usual limitations of most web browsers' text areas.
News
2011-04-11 - Released editmoin 1.17. Michael Hope contributed logic to parse common options out of the URL, and also to use sensible-editor (the command) as a default editor rather than vi.
2010-09-15 - Released editmoin 1.16. Splitted editing logic in its own function (Bjorn Tillenius), avoid showing the note message multiple times (Max Bowsher), allow arguments in $EDITOR variable (Scott Moser), and more.
2010-06-19 - Released editmoin 1.15. Introduced support for direct authentication with newer moins, inspired by Reimar Bauer. Added support for the ~/.moin_users file for username configuration, and for textcha questions.
2008-03-04 - Released editmoin 1.10. Integrated changes by Martin Pitt, improved vim syntax support, including a new vim syntax file for moin 1.6+.
2008-01-14 - Development switched over to Launchpad and Bazaar.
2007-05-25 - Released editmoin 1.9.1. Just a minor which adds a COPYING file to the tarball, as requested by Martin Pitt.
2007-03-09 - Released editmoin 1.9, including support for flagging changes as trivial (patch by Marc Tardif), and added support for strike (--( ... )--) markup in moin.vim.
2006-11-20 - Released editmoin 1.8, which includes support for the MOIN_SESSION cookie name used in Moin 1.6 (thanks to David I. Lehn and Daniele Favara for patches), and also introducing support for aliases, as documented below (thanks to Diogo Matsubara for the suggestion).
Usage
Its usage is simple and straightforward. Just provide moin's web page url as the first parameter. For example:
editmoin http://moinmoin.wikiwikiweb.de/TestPage
You can also use the -t parameter, to inform a template to base this page on. For example:
editmoin -t SomeTemplate http://moinmoin.wikiwikiweb.de/TestPage
Change settings
While you're editing a page you'll notice that a few settings are available at the top of the page. These settings are preceded by a @ symbol, and are immediately followed by the page body. These settings allow you to inform, for example, if you want subscribing users to be notified of your changes, or provide a comment for your change. Their functionality is simple, and their meaning, format, and usage should be obvious to you.
Selecting your editor
The default editor is vi. If you want to use any other, just set the EDITOR environment variable accordingly.
Hint: to use gvim as your editor, make sure you use the -f flag.
Setting your username
For editmoin to be able to authenticate you against the moin site you're accessing, it must know your username. For that, you must edit the file ~/.moin_ids and insert URL USERNAME pairs in it. For example:
http://moinmo.in YourUserName http://wiki.ubuntu.com http://example.com/moin/moin.cgi AnotherUserName
If the server needs Basic HTTP Authentication you can use something like:
https://username:password@example.com/moin/moin.cgi YourUserName
For using shortcuts (see below), and also for better control, defining URLs without IDs in that file is valid.
Setting your moin IDs explicitly
In remote times, authentication was done in moin using an ID, consisting mostly of numbers. Nowadays moin was improved to work with a more traditional username/password scheme. Even then, if the traditional username scheme mentioned above doesn't work for you, IDs may still be obtained after authentication, when the moin site sends your browser a MOIN_ID or MOIN_SESSION cookie.
Setting moin IDs consists of changing a file named ~/.moin_ids and inserting URL ID pairs in it. For example:
http://moinmo.in 987654321.321.54321 http://wiki.canonical.com http://example.com/moin/moin.cgi 123456789.123.12345
If the server needs Basic HTTP Authentication you can use something like:
https://username:password@example.com/moin/moin.cgi 123456789.123.12345
For using shortcuts (see below), and also for better control, defining URLs without usernames in that file is valid.
Aliases
Besides using shortcuts, it's also possible to define URL aliases in a file named ~/.moin_aliases. This file should contain lines with pairs of alias translation. For instance:
script http://moinmoin.wikiwikiweb.de/ScriptMarket
With this line present, one may execute a command like follows:
editmoin script/EditMoin
and get the expected result.
Notice that unlike shortcuts, aliases must match exactly to be considered. After the alias is translated, the resulting URL is also processed for matching shortcuts as specified below.
Shortcuts
Instead of using the whole URL, you may use a shortcut, which consists of any substring of an URL contained in ~/.moin_users and/or ~/.moin_ids, followed by a slash and an optional subpath. For instance:
editmoin canonical/FrontPage
Proxies
If you're behind a proxy, set the http_proxy environment variable, as usual.
Backups
Editing a moin page may take several minutes, or even hours sometimes. With this in mind, after you change some page it is saved in a file named ~/.moin_lastedit even before trying to commit it. This gives an extra protection against casual problems. Note that this file is overwritten every time a page is successfuly changed, so save it somewhere if you want to keep it.
Vim syntax highlighting
If you're a happy Vim user, you may want to use the files moin1_5.vim and moin1_6.vim, which are syntax highlighting files for Moin structured text format. There are two different files because the syntax has changed in an incompatible way in version 1.6 of Moin.
To enable syntax highlighting, put these files in a directory named ~/.vim/syntax/, and insert something similar to the following in your ~/.vimrc:
au! BufRead,BufNewFile *.moin \ if getline(1) =~ '^@@ Syntax: 1\.5$' | setf moin1_5 \ | else | setf moin1_6 | endif
A sligthly more complex version, contributed by Piotr Meyer, allows highlighting reStructuredText and MarkDown as well:
au! BufRead,BufNewFile *.moin \ let l=search("^$", 'n') \ | if search('^#format rst$', 'n', l) > 0 | setf rst \ | elseif search('^#format text_markdown$', 'n', l) > 0 | setf mkd \ | elseif getline(1) =~ '^@@ Syntax: 1\.5$' | setf moin1_5 \ | else | setf moin1_6 \ | endif
You can also choose to set the filetype explicitely in your moin file, by using a comment like the following at the bottom:
## vim:ft=moin1_6
Tested versions
This program was tested with the moin versions below. If it breaks or works with some other version, please let me know.
0.9
0.11
1.0
1.1
1.3.5
1.5
1.5.1
1.5.2
1.5.3
1.5.4
1.5.5
1.6
1.6.1
1.7
1.8
1.9
1.9.1
Disclaimer
This program expects information to be in a very specific format. It will break if this format changes, so there are no warranties at all. All I can say is that it worked for me, at least once.
Bug tracking
Bug tracking is done in Launchpad:
License
editmoin is available under the GPL.
Download