= Irwi Irwi is Ruby on Rails plugin which adds wiki functionality to your application. == Installation Setup gemcutter as gem source: sudo gem install gemcutter gem tumble And install irwi gem (recommended): sudo gem install irwi And add to your environment.rb: config.gem "irwi", :source => "http://gemcutter.org" Or in your application directory call: script/plugin install git://github.com/alno/irwi == Usage In your application directory call: script/generate irwi_wiki It will generate: * WikiPageController to serve wiki pages * WikiPage model to represent page * Migration to prepare database Also it will add to your routes.rb something like: map.wiki_root '/wiki' == Template definition You may create your own templates for controller actions (show, edit and history), in other case default built-in templates will be used. == Helper definition Following helpers are defined by default and you may replace them with you own: * wiki_user - Renders user name or link by given user object. By default renders <Unknown> for nil and "User#{user.id}" for others. == Configuration Configuration options are acessed via Irwi.options object. Currently supported options: * user_class_name - Name of user model class. By default - 'User' * formatter - Formatter instance, which process wiki content before output. It should have method format, which gets a string and returns it formatted. By default instance of Irwi::Formatters::RedCloth is used (requires RedCloth gem). Other built-in formatter is Irwi::Formatters::BlueCloth (requires BlueCloth gem). * comparator - Comparator instance, which builds and renders a set of changes between to texts. By default instance of Irwi::Comparators::DiffLcs is used (requires diff-lcs gem). == Access control If you want (and it's good idea) to specify which users can see or edit certain pages you should simply override following methods in your controller: * show_allowed? - should return true when it's allowed for current user to see current page (@page). * history_allowed? - should return true when it's allowed for user to see history of current page (@page) and compare it's versions. * edit_allowed? - should return true when it's allowed for current user to modify current page (@page). == Localization TODO Copyright (c) 2009 Alexey Noskov, released under the MIT license