On Saturday, December 2, 2017 at 7:29:05 PM UTC-8, Diego Mesa wrote:
>
> Can some one clarify on the use of << vs < when referencing variables...
>
In TiddlyWiki *content*, variables are referenced using <<variableName>>.
The double-bracket syntax is used to avoid conflicts with standard HTML
syntax (i.e., <b> starts normal HTML bold formatting, while <<b>> embeds
the value of a TiddlyWiki variable named "b")
However, within TiddlyWiki *filters*, there is no need doubling the
brackets, as HTML is not allowed *within* the filter, so only single
<variableName> is used.
...and why I don't have to wrap <fieldname> with [<fieldname>] before
> giving it to split.
Think of the brackets in filters as part of the operand itself rather than
a "container" for the operand. The type of bracket indicates the type of
operand being used:
use [...] for literal values, e.g., [texthere]
use {...} for field references, e.g., {!!fieldname}
use <...> for variables e.g. <currentTiddler>
Thus, to split the literal text, "sometext", you could write:
[title[sometext]splitbefore[t]removesuffix[t]]
you would get "some" as a result.
If the value "sometext" is stored in a field named "somefield" in the
current tiddler, you could write:
[{!!somefield}splitbefore[t]removesuffix[t]]
and, if the value "sometext" is stored in a variable named "somevariable",
you could write:
[<somevariable>splitbefore[t]removesuffix[t]]
As a slightly more complex example, suppose the value to split on was also
stored in a variable. Then you could write:
[<somevariable>splitbefore<othervariable>removesuffix<othervariable>]
hope this helps,
enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki: The Missing Manuals
--
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/6c2f5349-942b-478e-8168-b254c3ec2757%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.