Opening up my hiki wiki: bliki.rb plugin

You might have realized that eigenclass.org has been
changing subtly as of late. In addition to the cosmetic modifications, I've upgraded to hiki 0.8.6 and rewritten my hiki hacks as self-contained plugins.

The last one I've been working on allows you to enable
modifications to a set of nodes without opening up all of the wiki: creation
of new nodes is disabled, and some operations are restricted. This is what the
admin sees when editing a page:

hiki already ships with a plugin that allows you to restrict modification so
that only authenticated users can edit the wiki (and also to freeze some
pages), but my code allows you to open specific pages to everybody, while
keeping the rest of the wiki frozen*1.

Larger parts of eigenclass.org will become open if spam doesn't get too
annoying. I have several ideas to fight it, were it needed.

I'll release my hiki plugins in a while (which I sort of promised quite a
long time ago), but here's bliki.rb, so you can see how easily hiki can
be extended:

# Copyright (C) 2006 Mauricio Fernandez <mfp@acm.org> http://eigenclass.org# Use & distribution under the same terms as Ruby.def bliki_formcheckedtxt=@db.get_attribute(@page,:third_party_edit)?"checked":''<<EOS
<div>
<p><input type="checkbox" name="bliki.edit" value="true" #{checkedtxt}>Allow 3rd party changes</p>
</div>
EOSendadd_edit_proc{ifadmin?bliki_formelse""end}add_update_proc{ifadmin?if@cgi.params['bliki.edit'][0]=='true'@db.set_attribute(@page,[[:third_party_edit,true]])elsif@cgi.params['md5hex'][0]# means that we came here from an edit form, not a mere Plugin#save# which could be executed by {{bbs}} or {{comment}}@db.set_attribute(@page,[[:third_party_edit,false]])endend}def auth?admin?||(@page&&@db.get_attribute(@page,:third_party_edit))endexport_plugin_methods(:auth?)

There are a zillion plugins for hiki, easily making it the most featureful
wiki written in Ruby I know of.

Docs? - Matthew (2006-08-16 (Wed) 17:51:05)

Are there any good docs for Hiki? The site (at least the English part) is pretty sparse, and the source code seems pretty readable, but largely uncommented. For some of the plugins, the functionality and behavior isn't entirely obvious.

I'm definitely interested in seeing the remainder of your plugins when they're ready.

mfp 2006-08-18 (Fri) 05:59:34

Yes, there's little documentation. Fortunately, there are a lot of plugins serving as examples --- the first ones I wrote were but variants of the standard ones.

These are the plugins I've either modified or written from scratch:

aggregate.rb: node aggregation (this is what generates the frontpage and a couple other nodes on this site)