Hi Eric! > I'm wondering if you built your variant code after reading through an > *older* version of TaggedTemplateTweak (TTT). The current version is: > > version.extensions.TaggedTemplateTweak= {major: 1, minor: 4, revision: > 1, date: new Date(2008,8,29)};
The version I looked at was indeed older, used by RippleRap: http://svn.tiddlywiki.org/Trunk/verticals/ripplerap/core/plugins/TaggedTemplateTweak.js but at least was newer than the one I found here: http://svn.tiddlywiki.org/Trunk/contributors/EricShulman/plugins/SwitchThemePluginPatch.js I have a strong preference to use a copy from release control from the POV of stability and convenience for cook, deployment, etc. > The reason I think this might have been the case is that, contrary to > your documentation, both plugins *do* have the same priority for > applying "partially defined themes"... specifically, just as with your > code, TTT *does* look first in the current theme (aka, 'skin') to find > the matching template, and then looks for a separate tiddler only if > the template is not defined as a section of the theme. That's interesting, given that's the inverse behavior than the older version, I didn't envisage you making such a drastic change in the later version given making the tiddlers have priority over the skin has value; I can imagine a use-case where the Skin was the default theme which a user could change by adding a tagged template tiddler. I guess you realise this change breaks backwards compatibility for any application using TTT which relies upon such behavior. > Also (and again, contrary to your documentation), TTT does do a case- > *sensitive* lookup, followed by a fallback for case-*insensitive* > lookup. This fallback simply allows use of a leading lower case > letter on the tag value (the usual convention for most TW tags), with > proper WikiWord naming of the corresponding template, e.g, a tag of > "foo" will match [[fooViewTemplate]] first, with a fallback to > [[FooViewTemplate]]. I have to be honest, and didn't find this feature useful, and confusing, especially with TagsSuchAsThis. I much prefer the canonicalisation of tags to all lowercase with punctuation removed, this is common on sites such as Flickr. > Note that if both [[fooViewTemplate]] *and* [[FooViewTemplate]] were > to exist in the same document, (which, would be kind of odd, I > think...), then the "Foo" and "foo" tags would still be correctly > matched to their respective templates because the case-insensitive > lookup is only applied as a fallback if an exact, case-sensitive match > isn't found. As you say, that would be a little odd, but could be a valid use-case for someone. With my approach tags called FooBar, fooBar, foobar, etc all map to the single foobarViewTemplate and tiddlers called FooBarViewTemplate or even fooBarViewTemplate would be ignored. > The last difference you reported is that your plugin sorts the tags > first, so that they are scanned in alphanumeric order, while TTT just > uses the order of the tags as they occur 'naturally' on the tiddler. > This re-ordering of the tags *can* produce a difference in the > template that is selected for use (assuming there is a conflict > between two tags on the same tiddler), but both plugins will stop > scanning the tags when they find the first matching template, so any > difference in result is *entirely* due to the order in which the tags > are scanned. I actually think picking the template based on the order tags are defined, rather than by the priority of the names of the tags is a valid use-case, it's just happens not to be *my* use-case. > It would be a simple matter add sorting to the tag > lookup in TTT, so in this final regard, TTT would then completely > match the functionality you want. Then, you could continue to use TTT > to meet your needs, without having to "roll your own"... That's a generous gesture, and you of course you are free to add sort to your plugin regardless of what I think, but I might discourage it given it changes what might be for someone interesting behavior. We could make this optional, though that makes what is a simple idea into a complex piece of machinery. > thoughts? I thought long and hard before 'forking', and didn't do so lightly, but my thinking is this - we both find the notion of attaching templates by tag useful, and I dare say would both like to see this in the core: http://trac.tiddlywiki.org/ticket/840 However, as we're discovering, there are options on the way such mechanism might behave, and there are probably others we've not yet thought through, and all of which have valid use-cases. I therefore suggest we remain fellow travelers, and keep the fork. One thing I do feel bad about is if I misrepresented TTT in my documentation, for this I apologise. My intent was to highlight the differences to users, and in a way gather information from the marketplace. Given you are evolving TTT I've removed that documentation, but kept an encouragement for people to look at your plugin: http://trac.tiddlywiki.org/changeset/8227 Hope you're OK with this approach! With regards, Paul (psd) -- http://blog.whatfettle.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To post to this group, send email to TiddlyWiki@googlegroups.com To unsubscribe from this group, send email to tiddlywiki+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/TiddlyWiki?hl=en -~----------~----~----~----~------~----~------~--~---