> I want to create a minimal "todo list" formatter. Unlike the ones
> associated with GTD TiddlyWiki and others, I don't want the items in
> the list to be new tiddlers (it gets cluttered fast). I want it to be
> simple and formatter-based.
>
> When rendered, it would just add a checkbox element, and possibly a
> "completed" class on the list item element. The rest would be up to
> CSS. Changing the state of the checkbox would re-format the contents
> of the tiddler in place (BTW, is this easy/possible?).
>
> Thoughts? Somebody else wanna do it for me? :)
http://www.TiddlyTools.com/#CheckboxPlugin
does pretty much all you describe, and more... it has a variety of
ways to store the true/false 'state' of any given checkbox, including:
[x=chkSomething] - track state in config.options.chkSomething
[x(tagname)] - tag current tiddler when checked, remove tag when
unchecked
[x(tiddlername|tagname)] - tag the specified tiddler
[x(@fieldname)] - track state as a field stored in the current tiddler
[x(@fieldname)] - write field into the specfied tiddler
In addition, you can also specify bits of javascript code to invoke
custom onInit, onBeforeClick, and onAfterClick handlers that can
perform side-effects whenever the checkbox state changes. For
example, you could probably use the onAfterClick handler to add the
"auto-change the child checkboxes" handling that you described.
The plugin also automatically handles the 'refresh the display' logic,
with 3 possible target tiddlers to be re-rendered
* container: the tiddler in which the checkbox is displayed
* tagged: the tiddler that is being tagged
* tagging: the tiddler that *is* the tag (if it exists)
Using CheckboxPlugin, it is very straigtforward to create a simple to-
do list, where the states are tracked as tags on the current tiddler:
[x(foo)] foo description
[x(bar)] bar description
[x(baz)] baz description
simply setting/clearing a checkbox adds/removes the "foo", "bar", or
"baz" tags from the tiddler.
enjoy,
-e