On Wednesday, June 24, 2015 at 7:12:55 PM UTC-7, Jonnan wrote:
>
> Okay, I'm definitely not getting this syntax. Obviously I'm at the 'waving
> a dead chicken over it' point, but generally I *can* wave a dead chicken
> over it.
>
Admittedly, TW5 has it's twists and turns. But that's because it can do so
much! Still, there is a bit of a learning curve, and the current
documentation doesn't really do it justice.
Rather than trying to explain the depths of TW5 syntax here, I'll just try
to answer your immediate questions...
I want to make a generalized version of this from the tutorial:
> <<list-links filter:"[tag[Tag Template]] +[sort[title]]" >> where 'Tag
> Template' is the current tiddler.
>
There is a built-in variable/macro named "currentTiddler". Used in wiki
syntax, you can write <<currentTiddler>> to *display* the title of the
current tiddler. To use the variable value in filter syntax, instead of
[tag[text]], you can write [tag<variable>]. Thus:
<<list-links filter:"[tag<currentTiddler>] +[sort[title]]">>
After going through many variation trying to shoehorn variations of $title$
> {title} <$title$> and currentTiddler in that spot I found this thread.
> Given ...
> <$set name=title value={{!!title}}
> <<xxx>>
> </set>
>
> \define tags-test1() <$list filter="[tag[$(title)$]]+[sort[title]]" />
> <<xxx>> returns tag1tag2tag3... no ordering, but almost what I want.
>
you could write:
filter="[tag[$(title)$]] +[sort[title]]"
(put a space between the two filter "runs")
or:
filter="[tag[$(title)$]sort[title]]"
(make one run with both tag and sort operators)
\define tags-test2() <$list-links filter="[tag[$(title)$]]+[sort[title]]"
> />
> <<xxx>> returns Undefined widget 'list-links'
>
"list-links" (without the "$" prefix) is a TW core-defined *macro*.
To invoke a TW5 macro, use
<<macroname param:"value" param:"value">>
syntax. Thus:
<<list-links filter:"[tag[$(title)$]] +[sort[title]]">>
> \define tags-test3() <$list-links filter:"[tag[$(title)$]]+[sort[title]]"
> />
> <<xxx>> returns <$list-links filter:"[tag[Tag Template]]+[sort[title]]" />
>
Macros don't "wikify" their content before returning it. They simply
return their text, unaltered except for replacing the $(variable)$ and
$param$ markers with the corresponding values.
>
> I'm really not getting the syntax of the system here, even well enough to
> reproduce it for what ought to be really simple things, and the tutorial
> seems to me to skip from simple To do this one thing do 'X' to "It really
> quite easy you see <X{$(Y[X])$}> passes the variable as a parametrized
> function using the context of the Y-macro to reverse the polarity of the
> neutron flow".
>
I can appreciate your pain. The best way to address this is to keep asking
*specific* questions that have practical application. That way, we can
zero in on *examples* that really work.
In the mean time: NEVER EVER REVERSE THE POLARITY OF THE NEUTRON FLOW....
unless you have a charge of at least 1.21 gigawatts in your flux capacitor!
(and it helps if you are going faster than 88mph).
> I'd like to know where I went wrong in translating this to my tag-list
> function/template, but I'd really *love* to know if there an intermediate
> tutorial floating around somewhere that Googles not finding? I don't recall
> the old tiddlywiki being this obfuscated?
>
TiddlyWiki Classic was just as quirky, if not more so. The difference is
that TW5 has *much* more powerful syntax... and with that power comes
complexity. Still, it's worth the journey.
enjoy,
-e
Eric Shulman
ELS Design Studios
TiddlyTools - "Small Tools for Big Ideas!"
InsideTiddlyWiki: The Missing Manuals
YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
http://TiddlyTools.github.com/fundraising.html#MakeADonation
Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
http://www.TiddlyTools.com/#Contact
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/9cef9142-4ddb-4d3c-9d0b-76a6b91694da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.