idioms for architecting a mini-app TW and TW5

32 views
Skip to first unread message

funkyeah

unread,
Feb 29, 2012, 5:41:59 PM2/29/12
to tiddl...@googlegroups.com
So I've been looking into how I might go about creating tiddler specific mini-apps and was hoping to get some insight from experienced developers.

A simple example would be an interactive TODO list with template.

Now I know from searching that there is some existing code out there for this type of application:
http://www.TiddlyTools.com/#ChecklistScript
http://www.TiddlyTools.com/#ToDoList
http://www.TiddlyTools.com/#TaskPackage

but I am more interested in a best approach discussion on the items involved in implementing something like this.

The core requirements for this example and I think for many extensions of this example are as follows:
- Generic Template w/Javascript App: On initial creation pull the application template and javascript code from a template tiddler (requires something like TaggedTemplateTweak and InlineJavaScriptPlugin)
- Tiddler as a Datastore: Ability to edit data and possibly modify the existing template or template variables which are subsequently stored in the app tiddler (for example the FormTiddlerPlugin)
- On subsequent page loads the template would be repulled and template variables/data merged into the template

I think the important questions that come out of this are:
What are the common methods for implementing and using a parametrized template in TIddlyWiki?
What is the best way to have javascript attached to the instantiation of a template tiddler? (InlineJavascript plugin and a few script tags at the bottom of the template?)
What is the best way to use the tiddler itself as a datastore for the data and settings that could be entered or modified at the tiddler level?
If the template is largely HTML and the associated javascript enables modification of the elements from that template in a single instance (e.g. duplicate a row from a table)... How would that duplication be saved and reapplied when the instance is revisited?
Can you use JQuery to modify the HTML template inside a tiddler? (I am assuming you would need to get the tiddler text, parse the HTML structure out, and convert it to a JQuery object, but I could be totally wrong?)

For template creation the best resource I've found is the example at:
http://oldwiki.tiddlywiki.org/wiki/TiddlyTemplating/Creating_Templates

For editing and insertion into the template it seems like the DataTiddlerPlugin would be the best, but I'm not sure how it would apply to the script adding additional elements to the template.

So do these elements combine into one of the better ways to achieve the stated goal? What am I missing? Are there better resources or examples for me to clean this up?


Reply all
Reply to author
Forward
0 new messages