Generally speaking, I don't think TiddlySpace plugins should be
different from regular TiddlyWiki plugins - we want to avoid
fragmentation, jeopardizing interoperability and reuse.

> Since there are different devs, there are different styles :)

Indeed - I'm sure some people will disagree with some of my opinions below.

> I made a simple HelloWorld button plugin [1], and wrote my questions
> directly inside the code.

I'll respond inline:

> var me; // should it be var me, or var macro?
> config.macros.helloWorld = me = {

I tend to use "macro" to refer to a macro provided by the respective
plugin - though only if that plugin only provides a single macro, as
otherwise disambiguation is required.

However, many plugins don't need such a shortcut anyway, as you can
generally use `this` instead:
    config.macros.foo = {
        myDefault: "bar",

        handler: function(place, macroName, params, wikifier,
                paramString, tiddler) {
            alert(this.myDefault);
        }
    }

It's only required within methods whose `this` is mapped to an object
other than the current macro (e.g. event handlers).

> should createTiddlyButton, or a new jQuery routine, be used to get a
> propper button?

Well, createTiddlyButton is pretty much just a convenience function,
which might be considered obsolete in the face of jQuery. However, there
are some details (e.g. href="javascript:;") which perhaps make it worth
using, as it saves you the trouble of repeating/remembering those all
the time.

NB: There are functions like createTiddlyLink which might easily be
dismissed in similar fashion, but actually encapsulate important (and
sometimes subtle) aspects of TiddlyWiki functionality - those should
continue to be used.

> should data, be passed with jQuery data object, to the button or
> should attributes be used?

I generally prefer the former, as it seems cleaner.

> It would be nice, to get some thoughts, about, how to make macros for
> tiddlyspace and the public/private [draft] mechanism.

IMO, the draft mechanism is primarily for content - so developers should
either manually create a private tiddler of the same name or create a
separate space ("foo" and foo-dev" perhaps?).

Also, I tend not to use the install-only-once wrapper anymore:
http://trac.tiddlywiki.org/changeset/10237
http://svn.tiddlywiki.org/Trunk/contributors/FND/plugins/template.js
IMO, it generally only covers up the real issue, as a given plugin
should not exist twice in the same document in the first place.


-- F.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywikidev?hl=en.

Reply via email to