I have had a few people ask me about how to use cook for developing TiddlyWiki plugins. An unfortunate incident where a momentual loss of brain has resulted in me being without a power cable has forced me to use Windows and have to setup cook on it so I thought I'd share my wisdom while it is still fresh.
First things first you need to download the tool which can be found in
the svn cooker directory. You'll also need
Ruby for this to work.
Once this is all done you can execute
cook.rb to get cook to run. If you run cook.rb it will give you some usage instructions. The first parameter cook takes is the only one you should care about to start with. The parameter is a file path to a *recipe* and this file gives all the rules to creating your TiddlyWiki.
A recipe is essentially a set of rules of how to make a TiddlyWiki and the file name of the recipe is significant. A recipe with the filename "spaghettibolognese.html.recipe" will create a file with name "spaghettibolognese.html".
A recipe lists rules that are needed to be followed to make it. TiddlyWiki has a recipe which if included will create the latest version of TiddlyWiki in svn. The recipe can be found here
tiddlywiki core recipe.
The path must be relative to the location of the recipe.
ie.
recipe: ../core/tiddlywiki.html.recipe
means that the tiddlywiki core recipe can be found up one directory, then in the core directory.
Once you've got this cooking you should be able to view the outputed empty tiddlywiki. A recipe can also point to tiddlers.
To do this you add the line
tiddler: HelloWorld.tiddler
this points to the file HelloWorld.tiddler and this file should look something like this:
To include js files you probably want to remove the
and
bits and just have pure js code. You can associate meta data with a js file by creating a file with a .meta suffix.
ie. a js file "test.js" should exist alongside a file called "test.js.meta" where the latter file contains code like this:
title: TestPlugin
modifier: MeAgain
tags: [[a]] [[b]] [[c]]
There are also lots of useful things you can do including merging files
eg.
tiddler a.js b.js
will create a tiddler with meta data found in a.js.meta but the contents of both a.js and b.js. This is great for making plugins which make use of code in various locations.
I'll let you get the basics working - with the above this should be enough, but you may find the following page with basic cook usage instructions helpful. Of course comment, or post in the TiddlyWiki groups for more help.
Thanks for reading this far. Did I bore you or interest you? Let me get better at doing the latter and focus more on working on the good stuff...
Error Message
Macro 'ratemytiddler' not defined, or not allowed to call [restricted_mode=False]