Recipe Files

RecipeFiles tell Cook which chunks from the TiddlyWiki source tree get concatenated together to make a particular variant of TiddlyWiki. They are stored as UTF-8 text files.

RecipeFiles contain a sequence of statements from this list:

Statement Example Purpose
<filename> html/header.html Include a copy of the specified file
<!--@@label@@--> <!--@@prehead@@--> Names a point in the output file for later reference
recipe: <filename> recipe: ../../core/tiddlywiki.html.recipe Process a sub-recipe file (which can be nested)
copy: <filename> copy: images/field.jpg Causes a specified external file to be copied alongside the cooked TiddlyWiki
<label>: <filename> title: html/title.html Include a copy of the specified file at the previously labelled point
tiddler: <filename> tiddler: example.tiddler Include a copy of the specified tiddler file at the previously labelled point. This is a special case of the label statement: cook has knowledge of the format of tiddler files and pre-processes them before inclusion

These simple operations permit quite complex patterns of sharing to be set up. The best way to see this in action is to look through the SourceTree. For example, here are the various recipe files that are used to generate tiddlywiki.com:

It starts with /verticals/tiddlywiki.com/index.html.recipe:

recipe: ../../core/tiddlywiki.html.recipe
prehead: ../../core/html/rss.link.html
recipe: plugins/split.recipe
recipe: feeds/split.recipe
recipe: content/split.recipe
recipe: shadows/split.recipe
recipe: images.recipe
copy: attachments/firstversion.html
copy: attachments/secondversion.html

First, it references /core/tiddlywiki.html.recipe for the basic core tiddlywiki in it's entirety, with labels to allow the insertion of custom content at various key points: "prehead", "title", "posthead", "prebody", "tiddler", and "postbody". It references five other recipes to do the rest of the work: four for the individual content tiddlers, and one with the copy statements for the required images.

/verticals/tiddlywiki.com/content/split.recipe (previously generated by Ginsu):

tiddler: AlternativeColorPalette.tiddler
tiddler: AnotherExampleStyleSheet.tiddler
tiddler: AutoSave.tiddler
...
tiddler: example.tiddler
tiddler: systemServer.tiddler
tiddler: translations.tiddler

/verticals/tiddlywiki.com/images.recipe:

copy: images/brixhamharbour.jpg
copy: images/field.jpg
copy: images/forest.jpg
copy: images/fractalveg.jpg