Having read the doc about that topic and the use of the qualify macro as an example, I tried some variations of code to get used of what is OK and what is wrong. See the code below.
\define myMacro(stateTid:"")
<$vars stateTid={{{ [<__stateTid__>!is[blank]then<qualify "$:/temp/slider/$(currentTiddler)$/$stateTid$">else<qualify "$:/temp/slider/$(currentTiddler)$">]}}} >
This is <$text text=<<stateTid>> />
</$vars>
\end
\function .mySubfilter(acrr, target) [[qualify]addsuffix[ ]addsuffix<curr>addsuffix[/]addsuffix<target>dump[const. subfilter]]
\function .myFunction(stateTid)
[<__stateTid__>!is[blank]then<qualify "$:/temp/slider/$(currentTiddler)$/$stateTid$">else<qualify "$:/temp/slider/$(currentTiddler)$">]
\end
\function .myInner(curr, target) [<qualify>[$:/temp/slider/$(curr)$/$(target)$]]
\function .myOtherInner(curr, target) [[qualify]addsuffix[ ]addsuffix<curr>addsuffix[/]addsuffix<target>]
\function .myOtherFunction(hereTid, stateTid)
[<stateTid>dump[state]!is[blank]] :map[all[]dump[good curr].myInner<hereTid>,<stateTid>dump[res]] :else[.myOtherInner<hereTid>dump[alt]] +[dump[final]]
\end
\function .mySubfedFunction(hereTid, stateTid)
[<stateTid>dump[state within]'<hereTid>'!is[blank]]
:map[all[]dump[good curr].myInner<hereTid>,<stateTid>dump[res]]
:else[.myOtherInner<hereTid>dump[alt]]
:map[[<qualify "$1$">]dump[motif]substitute<currenTiddler>dump[exp with],<currentTiddler>,[AS]subfilter<currentTiddler>dump[final]]
\end
* <<myMacro clubs>>
* That is {{{ [.myFunction[clubs]] }}}
* And then {{{ [.myOtherFunction<currentTiddler>,[clubs]] }}}
* And last {{{ [.mySubfedFunction<currentTiddler>,[clubs]] }}}
note that dump is a filetr operator to output input on the javascript console with all arguments concatened with space before the array of thi input. Quite handy. I let thhem be here to show you what is happening.
Now, the output:
=============
- This is $:/temp/slider/macros parameters inside filters/clubs-2141172816
- That is $:/temp/slider/$(currentTiddler)$-2141172816
- And then $:/temp/slider/$(curr)$/$(target)$
- And last qualify
=============
in the javascript console we got:
23:52:31,675 paumé #1 Array [ ‘<qualify “clubs”>’ ]
23:52:31,681 state #1 Array [ “clubs” ]
23:52:31,681 good curr #1 Array [ “clubs” ]
23:52:31,682 res #1 Array [ “$:/temp/slider/$(curr)$/$(target)$” ]
23:52:31,682 final #1 Array [ “$:/temp/slider/$(curr)$/$(target)$” ]
23:52:31,682 state within #1 Array [ “clubs” ]
23:52:31,682 alt #1 Array [ “qualify macros parameters inside filters/” ]
23:52:31,683 motif #1 Array [ ‘<qualify “$1$”>’ ]
23:52:31,683 exp with qualify macros parameters inside filters/ AS #1 Array [ ‘<qualify “”>’ ]
23:52:31,683 final #5 Array(5) [ “qualify”, “macros”, “parameters”, “inside”, “filters/”
(things like #1
indicate that the input on the right has only 1 title)
Big Question: why in “mySubfedFunction” the “substitute” filter op does not succeed in outputting <qualify "macros parameters inside filters">
? My code seems so similar to the official example but is not working yet.