Mark S. ... But if I Josiah, David, and Mark (a popular 1960s folk music group, I think) were names of variables, then the filter could look like:filter="[<Josiah>] [<David>] [<Mark>]"
<$set name="digit-pattern" value="[0-9]{2}">
<<list-links "[regexp:title<digit-pattern>]">>
</$set>
That is helpful. It need to absorb it and play a bit to really "get" it. The missing piece for me is still I can't quite grasp what "level" I'm at in each thing. The "bracketing thing" in TW seems unusual. Morphing syntax? I get confused because it almost behaves as if it were part of the "code", not just a convention for containing it.
@TiddlyTweeter wrote:... The "bracketing thing" in TW seems unusual... I get confused because it almost behaves as if it were part of the "code"...
Eric wrote this somewhere and I copied and kept it in my TW. I ll paste this as it is (wikitext), so that you can copy and paste it in a tiddler: THANK YOU ERIC!
PS: I might also add, Eric is the best teacher when it comes to explaining code.
TT: The one thing that I'd like to know is whether, in all contexts, you need __underscore brackets__ to be "bracketed", i.e. does this construct always have to have "<<" or "<" etc. around it?Jermolene...The parameter name wrapped in double underscores is a valid variable name in its own right. When used in a filter it wouldn't have the double angle brackets:<<link-links "[tag<__tagname__>!sort[modified]]">>To put it another way: macro parameters are made available within the body of a macro as variables named with the parameter name wrapped in double underscores.
* One* """ Two This is a muliline item!"""* Third
# One
# """ Two
This is a muliline item!
"""
# Third
Is there a Crib Sheet that gives an overview of their variant use? They seem pretty important to understand well.
{{{
filter}}}
Here's a draft. If people make additions, corrections(!) etc, maybe it'll get good enough to be on tiddlywiki.com
Mat!Do you want to have "good practice" examples by Jeremy for these shorthand syntax?
--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
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/8632d1d0-162e-4e6d-9a9b-ae84dd165ee4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Shorthand syntax summary.json>
{{{
filter}}}
... its not so clear what that does.
It is really good to see a near comprehensive table. I'm wondering if there could be one more column with a link to any working examples?
* The table doesn’t distinguish between using a syntax as an attribute value vs. freestanding — for example, freestanding double curly brace transclusion will wikify the target tiddler, while attribute double curly brace transclusion will just return the raw text
* The <<__parameter__>> example is a bit misleading because there are two things going on: the automatic conversion of a parameter into a variable name, and the usage of that variable name with the double angle bracket syntax. If a macro transcludes a tiddler than that tiddler would “see” the double underscored parameters just like any other inherited variable
I also think it is important to know that if the value has no spaces other delimiters or quotes, it can be quote free eg value=my-fieldname
I suspect of you know all the "spaces other delimiters or quotes" that break this you should be fine, like the / in your examples, but I am not so sure how common this is.
I see what you are saying.
It is interesting how we develop different workflows. I now go direct to system tiddlers given a sidebar tab that lists recent system tiddlers with an edit button.
I often invoke a macro in the tiddler it is wriiten in, until Im happy and only then tag it as a global macro and test it in regular tiddlers.
It can be helpful sharing workflows we all develop independantly.
Regards
Tony
On Saturday, August 4, 2018 at 11:06:47 AM UTC-6, @TiddlyTweeter wrote:I can't admit I understand the complexity of "Brackets" (<> <<>> [] [[]] curly variants etc) or "Quotes" ("", '' '', ''' ''' etc).
Is there a Crib Sheet that gives an overview of their variant use? They seem pretty important to understand well.
Josiah
Eric wrote this somewhere and I copied and kept it in my TW. I ll paste this as it is (wikitext), so that you can copy and paste it in a tiddler: THANK YOU ERIC!
!! Types of BracketsBrackets are used to indicate the ''type of operand'':* `[]` - square brackets surround ''literal'' values,* `{}` - curly braces around ''field references'',* `<>` - angle brackets around ''variable names''.!! Single or Double Brackets - `<` vs `<<`In TiddlyWiki ''content'', ''variables'' and ''macros'' 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 to double the brackets, as HTML is not allowed ''within'' the filter, so only single `<variableName>` is used.Thus, inside a filter we can use a pair of ''single'' angle brackets, like this:```<$list filter="[is[current]!has<eachfield>]" variable=null>```!! Brackets within filters<<<Why I don't have to wrap `<fieldname>` with `[<fieldname>]` in a filter?<<<Think of the brackets in filters as part of the operand itself rather than a "container" for the operand. As explained above, 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:Ex: `<<list-links "[title[sometext]splitbefore[t]removesuffix[t]]">>`<<list-links "[title[sometext]splitbefore[t]removesuffix[t]]">>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,-eEric Shulman