On Thursday, June 25, 2020 at 6:21:00 AM UTC-7, OGNSYA wrote:
>
> Just so I can learn with my mistakes, what was wrong about my thinking 
> when I did this\?:
> {{{{!!sourcename}}!!myfield}}
>

You can't nest syntax (i.e, using transclusion syntax *inside* of 
transclusion syntax)

This is, in part, because the TiddlyWiki language is *interpreted* in 
real-time rather than "compiled" ahead of time,
and the parser is based on linear pattern recognition using "regular 
expressions" (regexp) rather than a recursive algorithm.
If the TWCore used recursion, then the overhead for processing the syntax 
would rapidly overwhelm the performance

for example, you can't embed a macro inside another macro
<<something param:<<somethingelse>> >>

and you can't use widgets inside of a widget parameter
<$somewidget param=<$someotherwidget ... />

and you can't mix TW macro syntax *inside* a parameter value
<$somewidget param="some <<macro>> text" />

Note that you CAN use a macro as a *whole* widget parameter:
<$somewidget param1="some text" param2=<<somemacro ...>> />

You can also use an "inline filter" as a *whole* widget parameter:
<$somewidget param={{{ [...somefilter...] }}} />

This also applies to HTML syntax, where you can use macros as parameter 
values:
<div class=<<somemacro>> style=<<someothermacro>>>...</div>

but you can't write this:
<div class=<<somemacro>> style="color:<<someothermacro>>" >...</div>

However, there are some interesting techniques for getting around the 
problem.  For example,
<div class=<<somemacro>> style={{{ [[color:]addsuffix<somevariable>] }}}" 
>...</div>
uses an inline filter to assemble the full style=... CSS syntax by 
appending a <variable> value to some literal CSS syntax

I know this seems very confusing, but it is *consistent*, even if it's not 
*conventional*...

-e

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/36e66d43-d942-49e7-a5a7-eb1c7cbbdc12o%40googlegroups.com.

Reply via email to