Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Batsman's 5-Line Wiki

DZone's Guide to

Batsman's 5-Line Wiki

·
Free Resource
Drop the code below in a file called w7.cgi. You’ll need to give executable permission for the web server to execute the script and write permission for the web server for the whole directory. (chmod 755 wiki/w7.cgi; chown www wiki).


#!/usr/bin/ruby -rcgi
H,B=%w'HomePage w7.cgi?n=%s';c=CGI.new'html4';n,d=c['n']!=''?c['n']:H,c['d'];t=`
cat #{n}`;d!=''&&`echo #{t=CGI.escapeHTML(d)} >#{n}`;c.instance_eval{out{h1{n}+
a(B%H){H}+pre{t.gsub(/([A-Z]\w+){2}/){a(B%$&){$&}}}+form("get"){textarea('d'){t
}+hidden('n',n)+submit}}}


Source: http://ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/122787
Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}