I read about it a few days ago, forgot about, found it again. *A wiki engine in four lines of Perl. It used to be available from Casey West’s Website.*
It looks ugly since both backlinks and edit box are part of the output. But then again that also makes it totally easy to use...
#!/usr/bin/perl use CGI':all';path_info=~/\w+/;$_=`grep -l {body}amp; *`.h1({body}amp;).escapeHTML$t=param(t) ||`dd<{body}amp;`;open F,">{body}amp;";print F$t;s/htt\S+|([A-Z]\w+){2,}/a{href,{body}amp;},{body}amp;/eg; print header,pre"$_<form>",submit,textarea t,$t,9,70
Features:
1. Automatic link back
2. Linking of WikiWords
3. Linking of URLs
In all fairness, let me list the non-features:
1. No recent changes
2. No version history
3. No inlined images
4. No text formatting rules
Later I found another very small one, in **eleven lines of Python.** It looks better than the four lines of Perl above, because backlink search only happens when you click on the title, and editing a page only happens when you click on the edit link.
http://infomesh.net/2003/wypy/
It even has lists! No old versions and no recent changes, of course.
#!/usr/bin/python import re,os,cgi;d,h=os.listdir('.'),'<a href=wy?';p,e,g,s=tuple(map(cgi.parse( ).get,'pegs'));f=lambda s:reduce(lambda s,(r,q):re.sub('(?m)'+r,q,s),(('\r','') ,('([A-Z][a-z]+){2,}',lambda m:('%s'+h+'e=%s>?</a>',h+'g=%s>%s</a>')[m.group(0) in d]%((m.group(0),)*2)),('^{{