Many times I have the following thought process and I don't know how to bridge the gap from source code to TW5 plugin. I'll have a neat HTML/CSS/JS snippit working in jsbin.com or jsfiddle.net and wish to add it to a TiddlyWiki document. Because it is multi format (HTML, CSS, JS, maybe a data URI based image) this presents some complication making it a one off plugin. Here is an example use case and workflow I'm in now:
I wrote an interactive map using canvas. It draws lines on the map. The map is a JPEG image that the JS reads via a data URI and draws it to the canvas. A table has click events attached to the cells to make the JS code draw arrows on the canvas. This all has four distinct files. So I thought this would be a great tiddler to add to a TiddlyWiki that I could have other documentation tiddler etc. Perfect for a one off documentation document I could pass around the office. Thing is, there is very little info on plugin writing for TW5. I realized that adding it to an empty TW was painful as the entire plugin needs to be packaged into a JSON object. So I had to start with tiddlywiki --init empty and start writing in a plugins folder. This handled the packaging but left me lost as what and where to place the pieces. And then how to integrate them into the TW system. At first I thought this could be a single tiddler but then I started to wonder if it should be a widget or maybe a macro. Not sure. Is there any guidance for writing plugins and the style / organization / conventions one should use? What exports are the plugins supposed to expose and how do you reference data like images to be read and managed via JavaScript (data URI possibly)? Any help pointing me into the right direction would be very appreciated. I'll happily take notes and maybe gather enough to write some tutorials. -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/tiddlywiki. For more options, visit https://groups.google.com/d/optout.

