No activity today, make something!
tweb-filters recipes

20161127105059 cdent  

A recipe is an ordered list of bags and filters that generates a list of tiddlers.

Recipes are used to create collections of tiddlers with a set of data and content customized for a particular use case.

If processing a recipe finds more than one instance of a tiddler with the same name, the tiddler from the most recently processed bag is the recipe list is the one used. This process is called the recipe cascade.

The exact storage or serialization format of a recipe is dependent on the store or serialization being used. Server-side tools working with recipes that wish to be flexible should not rely on any format, but instead, where possible, work with recipe objects.

twanager provides a command line tool for creating recipes. As a special case, this tool uses the text serialization of a recipe as the input. That format looks like this:

    /bags/system/tiddlers?select=tag:systemConfig;sort=-modified
    /bags/common/tiddlers

That is: one line per bag/filter pair, with the optional filter represented as a URL query string. There is no upper limit on the number of bags that may be present in a recipe, but at some point a long list of bags will likely cause processing to be slow.

As a special case, recipe lists can act as templates. In the example below {{ user }} is replaced by the name of the current user.

    /bags/system/tiddlers
    /bags/{{ user }}/tiddlers

(This handling can be manipulated from plugin code. See the _recipe_template method in tiddlyweb.control.)

Recipes may be created and updated over the HTTP API at /recipes/{recipe_name}.