AppendWikiPage

Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


appendWikiPage is a bash script that will take an email message (or any other file piped into it), and create a PmWiki page. In combination with procmail, it will allow you to setup a special email address to which you can send information that you'd like to have included in your PmWiki, without having to create the page manually.

Download the script here.

Setup

  • Copy the downloaded file, appendWikiPage, somewhere convenient. I keep mine in my ~/bin directory.
  • Copy the program pmwe from the pmwiki/scripts directory, to a location in your $PATH. Verify that pmwe works by running it and editing a wiki page. Typing "pmwe", from the command line, should allow you to edit the Main.WikiSandbox page located at http://www.pmichaud.com/wiki/Main/WikiSandbox.
  • Verify that the following programs are available on your system, somewhere in your $PATH:
      echo, grep, & sed
  • Edit the following variable in appendWikiPage:
WikiDir: the path to a temporary directory on your local system (i.e. /var/tmp)
  • Add the following receipe to your .procmailrc:
      
      # send 'wiki' files to wiki
      :0                                 
      * ^TOappendWikiPage@mydomain.com
      | /home/tom/bin/appendWikiPage 
Be sure to edit the "TO" line to reflect the desired email address, and the last line to the location where you saved appendWikiPage in step #1.
  • You'll need to setup the proper alias in your MTA to forward any mail that is sent to appendWikiPage@mydomain.com (for example) to your regular email address (so that the procmail receipe will be executed). Alternately, setup a new user named appendWikipage and put the procmail recipe there.
  • Setup is complete.

Usage:

A WikiPage will be created from any mail sent to appendWikiPage@mydomain.com. The title of Group.Page will be determined by the following markup, containing within the email message itself:

append:Groupname.PageName?: beginning of selection
append:?: end of selection
  • If the WikiPage already exists, the selected text is appended to the end of the existing page.

Example markup

append:Main.LinuxTipsTricks?
This paragraph will be appended to the page Main.LinuxTipsTricks. If the page doesn't yet exist, it will be created.
append:?

append:Dogs.ColliesAreFun?
This is another paragraph in the same email message, regarding a different subject. It will be saved to the page Dogs.ColliesAreFun.
append:?

Questions/suggestions

  • Feel free to send email to tom@hisword.net.

pmwiki-2.3.38 -- Last modified by {{Michael Geddes}}?

from IP: 85.171.160.186 ip should be disabled by default for security reasons