Hi Tobias,

That certainly looks more elegant, but I can't get it to work. First I
got a macro error, found [1] and accordingly changed

config.macros.myTimeline.handler = function(place,macroName,params)

to

config.macros.myTimeline.handler =
function(place,macroName,params,wikifier,paramString)

and

p = params.parseParams(null,null,true);

to

p = paramString.parseParams(null,null,true);

which fixed that error but results in the macro evaluating to a blank.
I don't really know the function of params vs paramString, nor how to
debug/show what ends up in 'inc'. Can you figure it out?

cheers,

~P

-------

Also, for later readers' reference: it seems that the <<tabs>> macro
now no longer resides directly in SideBarTabs (cf Eric's step (10))
but in Backstage _via_ SideBarTabs.

[1] http://tiddlywiki.org/wiki/Dev:Custom_Macros#Getting_Parameters


On Oct 27, 3:21 pm, Tobias Beer <[email protected]> wrote:
> Hi P,
>
> You can much simplify your codebits. Personally I would do it like
> this using named parameters instead of the params array as a whole...
>
> //at the beginning of your handler declare
> var tgs,
> p=paramString.parseParams(null,null,true),
> inc=getParam(p,'include','').readBracketedList(),
> ex=getParam(p,'exclude','').readBracketedList();
>
> //Later... get tags and check them...
> tgs=tiddler.tags||[];
> if(
>         !tgs.containsAny(inc)||
>         tgs.containsAny(ex)
> )continue;
>
> So your macro would read...
>
>  <<myhistory
>         include:'"this tag" [[or that]] tag'
>         exclude:'excludeHistory'
>  >>
>
> Cheers, Tobias

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" 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/tiddlywiki?hl=en.

Reply via email to