Thanks, I'll look into this.
I did realise that the myMacro was only an example :) - the problem was/is
that I should be able to pass data to the macro, and the {{...}} should
cause the included expression to be evaluated before being passed as data
to the macro. So then, the store.getTiddlerText("YourTiddlerName") should
be evaluated and the text the passed off to myMacro.
So, if that understanding is correct, I had 2 apparent problems:
1.) should I use tiddler.getTiddlerText (as per wiki), or
store.getTiddlerText (as per tiddlySpace FAQ)? From your reply I can see
that you favour the latter, so I'll persist with that
2.) no apparent evaluation was occurring inside the {{...}}. Again, using
your reply I can seen an alternative, but I'm still a little curious as to
what's happening in my initial situation.
Anyway, on the cat-skinning principle, I'll wander off and try your
suggestion(s) & let you know how it goes.
Thanks again, Andrew
On Friday, June 22, 2012 6:10:43 PM UTC+10, whatever wrote:
>
> Hi!
>
> the myMacro is only an example. You actually need to write your own
> macro in javascript.
> To get the tiddler text, you need to use the following:
> var text = store.getTiddlerText("YourTiddlerName");
>
> Then you can use the text variable further on. Check out a random
> tiddlywiki plugin to see how the macros are declared.
>
> Perhaps some other javascript guru can write a more detailed
> explanation.
>
> As an alternative plan, however, perhaps you can use the
> forEachTiddlerPlugin (1) and simple transclusions:
>
> In tiddler called "Lists" (or whatever you wanna call it), put:
> !Base
> <<forEachTiddler where 'tiddler.tags.contains("myTag")'
> write '"<<tiddler [["+tiddler.text+"##Base]]>\>\n"'>>
> !Annotations
> <<forEachTiddler where 'tiddler.tags.contains("myTag")'
> write '"<<tiddler [["+tiddler.text+"##Annotations]]>\>\n"'>>
> !Macro
> <<forEachTiddler where 'tiddler.tags.contains("myTag")'
> write '"<<tiddler [["+tiddler.text+"##Macro]]>\>\n"'>>
>
> In another tiddler, put this:
> <<tabs txtMyTabs "Base" "Base" "List##Base" "Annotations"
> "Annotations" "List##Annotations" "Macro" "Macro" "List##Macro">>
>
> That way you have three tabs and each contains certain content. If I
> understood correctly what you wanted, of course. :D And I'm sure there
> are other solutions.
>
> (1) http://tiddlywiki.abego-software.de/#ForEachTiddlerPlugin
>
> w
>
> On Jun 22, 8:34 am, tejjyid <[email protected]> wrote:
> > A couple of things - maybe they should be separated:
> >
> > I was wanting to create a <<tabs>> based structure, where one tab would
> > show a base text, and other tabs would show (programmatic) annotations
> of
> > this base. I thought each tab could point to a macro with a parameter
> > string which included the original base text.
> > So I tried <<myMacro {{tiddler.getTiddlerText(myTiddler)}}>>
> followinghttp://oldwiki.tiddlywiki.org/wiki/Dev:Custom_Macros, and then I
> looked athttp://
> tiddlywiki.tiddlyspace.com/#TiddlyWiki.prototype.getTiddlerText,
> > which looked like an alternative plan, but neither worked. It seems that
> > the string is never evaluated before being passed to the macro.
> >
> > So the 2 things are:
> >
> > 1.) Why are the getTiddlerText methods(?) not working, and
> > 2.) Is there a pre-existing template/macro/script for doing what I want
> to
> > do?
> >
> > Clarifications on request :-)
> >
> > Thanks in anticipation
> > Andrew
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/tiddlywiki/-/0JY5ruOIxqAJ.
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/tiddlywiki?hl=en.