Peer Pressure

Stuff to look at about looking at stuff. From Chris Dent. What?

Archive

Oct
18th
Sat
permalink

TiddlyWeb Plugins

An update on things TiddlyWeb.

Much of the work lately has been on making TiddlyWeb easier to extend. When I first started working on TiddlyWeb, I was committed to the idea that the service should be as small and simple as possible: satisfying its primary goals and nothing else while being transparent. To reach this goal I decided it was best to avoid using a web framework (such as django, pylons or turbogears) because in my experience such things sort of obscure much of the mechanics of the system, and as a new Python programmer I wanted to see and expose as much of that stuff as possible.

So, TiddlyWeb is a fairly raw WSGI-based service that can be run with a variety of servers (cherrypy’s wsgi server is included, it can run as a straight CGI, there are instructions for integration with mod_python, and a googleappengine version exists). It uses its own pieces of middleware to manipulate the incoming request and transform the outgoing response. Here’s a confusing diagram for your edification:

TiddlyWeb Structure

Irony, this looks a lot like a framework, and in fact this has proven to be the case. TiddlyWeb has become a fairly complete framework for building systems that required authenticated access to tiddlers stored on a server. The evolution has been mostly in response to user requests (people developing things like the Plugin Library) and the exigencies rising from experiments like twoter and spowt.

The latest feature coming out of this work is a simple way to do plugins in TiddlyWeb. Twoter and spowt have been turned into plugins, extending the URL space of the system; the plugin library uses a plugin to extend the filtering system; a static file delivery plugin has been written.

In nice Python fashion, a plugin is a module that gets imported into the process and then does pretty much whatever it wants. It can extend the URL map, change function definitions, manipulate the database. The only requirement is that it have an init(config) function which can just pass if config is not needed.

Some experimental plugins can be found in my space in tiddlywiki svn. They show how they are used and may give some idea of the possibilities.

I hope my dear old uncle Ingy will be proud. It’s rare for me to intentionally encourage such unfettered possibilities.

Comments (View)
blog comments powered by Disqus