modifier: YourName
created: 200808291100
modified: 200810230938
type: None
tags: 
title: WhatIsTiddlyWeb

This is a slightly adapted version of an email sent from ChrisDent to some folk who asked about TiddlyWeb.

I get the "What is TiddlyWeb anyway" question a fair amount these days so I thought I would write something down.

I'll start from the [[Python]] angle: TiddlyWeb is a [[WSGI]] app using [[Selector]] for dispatch that provides a simple REST API to access [[Tiddler]]s, [[Bag]]s, and [[Recipe]]s in various representations (text, html, json and "wiki" at the moment). A Tiddler is the "page" of a TiddlyWiki, the indvidual mircocontent piece. A Bag is a collection of Tiddlers with a [[Policy]] that sets access control for operations on the Tiddlers within. The combination of a bag's name and a tiddler's name is the unique name of the Tiddler on the TiddlyWeb server. A Recipe is a list of a Bags, with optional filter string. A Recipe is processed to generate a list of Tiddlers that are available for some purpose.  As the recipe is processed, name collisions are resolved so that the Tiddler from the later Bag wins. This means that a recipe can make use of a bag where some defaults are set, but a later bag will override those defaults.

This Recipe and Bag concept is from the mind of JeremyRuston, the TiddlyWiki creator. It replicates a similar cascade effect that happens in TiddlyWiki but extends it to include multiple users and permissions.

The basic idea is that a TiddlyWeb is a place for a group of any size to store some Tiddlers and use the Recipe and Bag concepts to generate lists of Tiddlers for various uses. The special sauce is that those lists of tiddlers can be presented as a TiddlyWiki which has the capacity to synchronize Tiddler changes back to the TiddlyWeb store, either immediately as the content is changed, or later if the TiddlyWiki has been taken offline.

Because all of TiddlyWiki's configuration and plugin power is the result of Tiddlers (plugins are Tiddlers themselves) it means TiddlyWeb can be a pretty expressive generator of TiddlyWikis.

For example, say I have gathered together a bunch of plugins which result in a rather nice blog engine riding on top of the TiddlyWiki system. I can place these in a bag called BlogEngine and then make a recipe that looks like this:

{{{
  /bags/BlogEngine/tiddlers
  /bags/ChrisDentBlogContent/tiddlers
  /bags/ChrisDentBlogComments/tiddlers
}}}

The TiddlyWiki generated by the Recipe is my blog editing environment. I can configure things so that by default my new content is written to the ChrisDentBlogContent bag.

I can then have another Recipe which is the one I publish to people:

{{{
  /bags/BlogEngine/tiddlers
  /bags/ChrisDentBlogContent/tiddlers?[sort[-created]] [count[20]]
  /bags/ChrisDentBlogComments/tiddlers
}}}

This presents the 20 most recently created blog entries. In this situation new content would be written to the BlogComments bag, controlled by some plugin that came from the BlogEngine bag. The policy for the bags would allow read on the first two and create and read on the last.

It's likely that there are lots of other tools that do this sort of thing, but they don't have the benefit of the established and interesting TiddlyWiki UI and plugin architecture. The flexibility is sort of noisy but has proven many times over in the TiddlyWiki community to work really well in allowing unexpected uses. What TiddlyWeb is doing is moving that flexibility out from the single TiddlyWiki file and onto the web where the Tiddler content can have all the usual benefits of being first class on the web (linkability, reuse, inspectability, etc).

To maintain the TiddlyWiki flexibility in the TiddlyWeb environment I've made sure to be as web friendly as possible: exposing resources not actions, allowing multiple content-types; making sure the generated HTML is navigable; building storage, serialization and authentication models that are easy to extend (just add another module that supports a simple interfae).

So to be more specific about what TiddlyWeb is doing:

* You can get lists of Tiddlers built from Bags by Recipes.
* When you get them as HTML you can navigate around in them.
* When you get them as 'wiki' you get a TiddlyWiki which can synchronize content (Tiddlers) back to the network store.
* Tiddlers can be PUT to the store as JSON or Text.

The server at 

   http://peermore.com:8080/

is usually up to date with the latest code, which is here:

   http://trac.tiddlywiki.org/browser/Trunk/contributors/ChrisDent/experimental/TiddlyWeb

I need to come up with a way to make the server be a little more self-explanatory so casual visitors can get a bit more inspired by it. I don't, however, want to turn the server into a proper web page: it's a web service that happens to work for people too. Maybe that's a constraint I should remove?

Thanks for listening. Keep in touch.
