MaxWiki

Wiki Wiki means “fast” in Hawaiian. This is appropriate since Wikis are very fast to edit. Once you are logged in, every page has an “Edit” link that allows you to edit that page. This is much easier than the old way of changing a web site which required you to start up FrontPage or another web editing program, find the page you want to edit, make the changes, then upload them to the web site. I find that using a Wiki, even if I have just a few minutes, sometimes I will update a page or fix a spelling error where under the old method, I would never do this.

Instiki and RoR

The particular Wiki I am using is Instiki, which uses Ruby on Rails (RoR).

I first turned the “TriCities Baseball;:http://www.tricitiesbaseball.org site into a Wiki before doing the same to this site.

I needed to enhance Instiki so that Ruby on Rails ERB code could be inserted in a wiki page too. This was useful to be able to pull a schedule, like the Giant’s schedule from the database and show it in a wiki page. And anyone with an editor role can edit or add events right from that page.

The command to do this is:

<%= schedule :level => 'Minors', :team => 'Giants' %>

But of course, that still wasn’t enough, so I added the ability to show a Google map on a page with the command like:

<%= map :center => "-122.02016830444336, 37.31850270698815" %>

Other things we can do with Ruby ERB code in a wiki page are:

  • Set variables for the page title
  • Show the proper “Login” or “Logout” link
  • Highlight the current page in the page menu
  • Automatically create a team menu
  • Obscure email addresses

Textile

The formatting of the pages is done using Textile, which makes it easy to create nice looking pages without having to remember all the HTML codes.

Challenges

Now, this doesn’t seem like a whole lot and certainly doesn’t seem like it should have taken four months. But I had some challenges along the way:

  • Integrating my code with Instiki and Salted Password
  • Fixing some bugs in Textile so the tests would work
  • Modifying Textile so that it would pass Ruby ERB code through unchanged
  • Fixing several bugs in Instiki like one that caused problems when a schedule was put on a page because a controller had to call another controller
  • Modifying the schedule code so that when an event was added or edited from a wiki page, it would return to that page
  • Getting the filters working right so that it would show only the specified team or level
  • Using the latest Rails “edge” code
  • Fixing several Rails bugs like one that caused my tests to fail and fixing the SQL aliased table names
  • Writing tests and getting them all to work

MaxWiki Web Site

Here are some web sites that I have built using MaxWiki: