Sha256: 679c4df299a6e7dc20998d087106056941ee184f4b113eef0a4da9b5c5dda4ad

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

h1. API for classes to modify the wiki

There is a very simple API for classes to modify the wiki.

Any class can register to be notified of changes to the wiki by:

* @@wiki.watch_for( :page_created ) { |event, page, revision| do whatever you want }@
* @@wiki.watch_for( :page_revised ) { |event, page, revision| do whatever you want }@
* @@wiki.watch_for( :page_deleted ) { |event, page, revision| do whatever you want }@

These notifications are sent by a separate low priority thread from the one that is interacting with the user.   Using these notifications a class can make changes to the wiki by calling:

<code>
@wiki.revise( pagename, newcontent, author )
</code>

The normal place for these classes to be initialized is from the start.rb file.  The normal place for these classes to be stored is in the soks/lib/helpers directory.

Examples of helpers that use this api:
* [[AutomaticSummary => automatic summaries]] (which in turn are used by the SiteIndex and RecentChanges classes.
* AutomaticCalendar and AutomaticUpcomingEvents
* rss2wiki
* mail2wiki
* wiki2html

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
Soks-0.0.6 templates/default/content/Api%20for%20classes%20to%20modify%20the%20wiki.textile
Soks-0.0.7 templates/default/content/Api%20for%20classes%20to%20modify%20the%20wiki.textile