[tw] Re: Transclusion and Substitution ambiguity

2017-09-21 Thread TiddlyNoob
Thanks for the reply. That's what I figured the documentation was trying to 
explain. 

I really think the documentation needs to be more explicit about the fact 
that substitution is not a general concept, rather it is a specific process 
in the context of TW, given that it only applies to a very specific 
situation (replacing variables and parameters in macro definitions during 
macro calls). 

The definitions of both transclusion and substitution are very imprecise, 
and the distinction the documentation makes between substitution and 
transclusion (Substitution happens before wiki text processing) is very 
ambiguous, because for example, it leaves you thinking the attribute 
examples are substitution, not transclusion. The definition of transclusion 
states that it is the process of including the contents of one tiddler in 
another tiddler, but clearly there is a much more broad usage.

On Wednesday, September 20, 2017 at 7:41:07 PM UTC-4, Mark S. wrote:
>
> I was kind of waiting for the question ;-)
>
> It might be better to look at the documentation for substitution. 
> Everything you saw on that page gave examples of transclusion. Substitution 
> occurs *inside* macros using either $var$ or $(var)$ (environmental 
> variables).  In the example 
>
> <$text text=<>/>
>
> The *results* of a macro are being transcluded as the value passed to the 
> text attribute. Substitution would only occur if you called a macro with 
> parameters (or used environmental variable markers)
>
> \define myMacro() $(currentTiddler)$ is my favorite tiddler
>
> If you were then inside the tiddler, CatTiddler the results of the above 
> text widget would be:
>
> CatTiddler is my favorite tiddler
>
> The value of <> would be transcluded to the text attribute, but 
> the substitution would occur inside the macro.
>
> The main thing to get out of this is, whenever you need to join 2 pieces 
> of text, you are probably going to need a macro and it's text-substituting 
> ability.
>
> It's probably best not to get hung up on the terminology at the start. Try 
> a few examples of your own for transclusions and maybe even defining/using 
> your own macros. 
>
> Good luck,
> Mark
>
>
> On Wednesday, September 20, 2017 at 3:29:29 PM UTC-7, TiddlyNoob wrote:
>>
>> Hey guys,
>>
>> I'm a software developer and just started learning TiddlyWiki a few days 
>> ago. I'm trying to grasp the fundamentals before delving too deep in the 
>> complicated stuff. 
>>
>> Transclusion seems like an important concept to grasp, and I could get by 
>> with the general understanding that it's simply including the contents of a 
>> macro, variable, or tiddler field in some context, whether it be in the 
>> body of a tiddler, or as the value of an HTML attribute, but I can't help 
>> but question the ambiguity in the documentation, especially when it 
>> compares transclusion to substitution.
>>
>> The definition of transclusion in 
>> the documentation describes it as a process of including the contents of 
>> one tiddler into another tiddler.
>>
>> The Transclusion and Substitution 
>>  documentation 
>> basically describes every type of substitution as an example of 
>> transclusion, whether it's a tiddler field, macro, or variable you are 
>> referencing, and whether or not you are doing it in the body of a tiddler, 
>> or in a filter, or as the value of an attribute. It then goes on to say 
>> that the key distinction between transclusion and substitution is that 
>> substitution happens before WikiText processing, so it's just a simple 
>> substitution of text without WikiText processing. Transclusion, however, 
>> includes WikiText processing.
>>
>> But the example it gives for transclusion of a macro in an attribute:
>>
>> <$text text=<>/>
>>
>> ..seems to be just regular substitution, since there is no WikiText 
>> processing.
>>
>> This confusion seems apparent in other places in the documentation as 
>> well, such as in HTML in WikiText 
>> , where it describes 
>> examples that use tiddler fields attr={{tiddler}} as using transclusion, 
>> but then the macro examples >> do not 
>> mention transclusion at all.
>>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/6cac51d9-bd31-4ed1-8cd4-ca8cd6a08988%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Transclusion and Substitution ambiguity

2017-09-20 Thread 'Mark S.' via TiddlyWiki
I was kind of waiting for the question ;-)

It might be better to look at the documentation for substitution. 
Everything you saw on that page gave examples of transclusion. Substitution 
occurs *inside* macros using either $var$ or $(var)$ (environmental 
variables).  In the example 

<$text text=<>/>

The *results* of a macro are being transcluded as the value passed to the 
text attribute. Substitution would only occur if you called a macro with 
parameters (or used environmental variable markers)

\define myMacro() $(currentTiddler)$ is my favorite tiddler

If you were then inside the tiddler, CatTiddler the results of the above 
text widget would be:

CatTiddler is my favorite tiddler

The value of <> would be transcluded to the text attribute, but 
the substitution would occur inside the macro.

The main thing to get out of this is, whenever you need to join 2 pieces of 
text, you are probably going to need a macro and it's text-substituting 
ability.

It's probably best not to get hung up on the terminology at the start. Try 
a few examples of your own for transclusions and maybe even defining/using 
your own macros. 

Good luck,
Mark


On Wednesday, September 20, 2017 at 3:29:29 PM UTC-7, TiddlyNoob wrote:
>
> Hey guys,
>
> I'm a software developer and just started learning TiddlyWiki a few days 
> ago. I'm trying to grasp the fundamentals before delving too deep in the 
> complicated stuff. 
>
> Transclusion seems like an important concept to grasp, and I could get by 
> with the general understanding that it's simply including the contents of a 
> macro, variable, or tiddler field in some context, whether it be in the 
> body of a tiddler, or as the value of an HTML attribute, but I can't help 
> but question the ambiguity in the documentation, especially when it 
> compares transclusion to substitution.
>
> The definition of transclusion in 
> the documentation describes it as a process of including the contents of 
> one tiddler into another tiddler.
>
> The Transclusion and Substitution 
>  documentation 
> basically describes every type of substitution as an example of 
> transclusion, whether it's a tiddler field, macro, or variable you are 
> referencing, and whether or not you are doing it in the body of a tiddler, 
> or in a filter, or as the value of an attribute. It then goes on to say 
> that the key distinction between transclusion and substitution is that 
> substitution happens before WikiText processing, so it's just a simple 
> substitution of text without WikiText processing. Transclusion, however, 
> includes WikiText processing.
>
> But the example it gives for transclusion of a macro in an attribute:
>
> <$text text=<>/>
>
> ..seems to be just regular substitution, since there is no WikiText 
> processing.
>
> This confusion seems apparent in other places in the documentation as 
> well, such as in HTML in WikiText 
> , where it describes 
> examples that use tiddler fields attr={{tiddler}} as using transclusion, 
> but then the macro examples >> do not 
> mention transclusion at all.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/ac221443-0f7e-4a98-a770-aa42218ab4af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.