Hello!

2 macros combo - is it still an only way to generate a link in TW5 ?

I am trying just to generate link as [[LinkText|some text+{{!!code}}]]
and nothing of following doesn't work 

\define getfoo(title=<<current>>)
{{foo1!!code}}
\end


test <<getfoo>>


[[{{foo1!!code}}]]


[[<<getfoo>>]]


<$link to=<<getfoo>> >Link Text</$link>


<$link to={{foo1!!code}}>Link Text</$link>


<$link to=<$transclude field="code/> >Link Text</$link>



понедельник, 2 декабря 2013 г., 20:16:32 UTC+3 пользователь Jeremy Ruston 
написал:
>
> On Mon, Dec 2, 2013 at 4:30 PM, Stephan Hradek <[email protected] 
> <javascript:>> wrote:
>
>> So I found one way which seems to work - but I don't see the logic in it.
>>
>> \define the_link()
>> [[Comment for '$(x)$']]
>> \end
>>
>> \define okay_link()
>> <$set name="x" value={{!!title}}>
>> <<the_link>>
>> </$set>
>> \end
>>
>> <<okay_link>>
>>
>>
>> A similar way, but one level less does not work:
>>
>> \define nok_link()
>> <$set name="x" value={{!!title}}>
>> [[Comment for '$(x)$']]
>> </$set>
>> \end
>>
>> <<nok_link>>
>>
>>
>> The reason that the second example doesn't work is because the variable 
> 'x' doesn't exist at the time that the macro parameters and variables are 
> being substituted. The nested macros are a way around that.
>
>> To be honest: I find this quite confusing (and frustrating).
>>
>> What's most confusing: We have several ways of accessing similar stuff.
>>
>> At least we have:
>>
>> $parameter$ - for macro parameters
>>
>> $(variable)$ - for variables
>>
>> It seems to me as if these variables are a kind of a global for macros but 
>> do not work outside of macros.
>>
>> <$set name="variable" value="val">
>> here we can't use $(variable)$
>> while <<macro>> will be able to use it
>>
>> </$set>
>>
>>
>> Variables and macros are actually the same thing.
>
> Variables do work outside of macros (via the <<variable>> syntax, or 
> <$macrocall> widget), but there's no text substitution outside of macros, 
> which is why the $(variable)$ syntax doesn't work outside of macros.
>
> Best wishes
>
> Jeremy
>
>  
>
>>
>>
>>
>>
>> -- 
>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/tiddlywiki.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Jeremy Ruston
> mailto:[email protected] <javascript:>
>

-- 
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/b2d80d34-8c16-4a20-8555-60d76a03faf2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to