[tw] Re: [TW5] Transclusion of the tiddler caption as a description for a link

2015-08-13 Thread Łukasz Hirt
I see :) That makes me more and more aware of what I am doing. 

Actually I've got this idea to use single-quotes instead of tripple 
double-quotes, i.e. I've replaced """$tiddler$""" with '$tiddler$' and it 
works as well taking less space. 
However it will not work if someone wishes to use single-quote, so your 
method will make everyone happy :)

Thanks once again. I wish you all the best :)

-- 
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 http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/1682872e-0022-4a26-88a3-492af24ae846%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] Transclusion of the tiddler caption as a description for a link

2015-08-12 Thread PMario
Good question :)
Change to code to:  <$link to="$tiddler$" ...  and try to call the 
following tiddler name: [[asdf"asdf]]

<>

or 

<>

-mario

-- 
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 http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4f1e0932-3be6-46f6-832f-8082cab861c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] Transclusion of the tiddler caption as a description for a link

2015-08-12 Thread Łukasz Hirt
Hi,

Thank you for your answer :) that makes sense, good to know that there are 
some limitations, well I am aware that there are always some limitations,
but good to learn a new thing.

PS. I understand the code you provided, but I am curious why you enclose 
parameters with """  """ ?
The only purpose of that I am familair with is to allow Hard line breaks. 

Is there any other reason we use it here?

Regards,
Lukasz






-- 
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 http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/1e814831-cd4b-494c-8d66-b682f8a4bb32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] Transclusion of the tiddler caption as a description for a link

2015-08-12 Thread PMario

On Tuesday, August 11, 2015 at 9:40:55 PM UTC+2, Łukasz Hirt wrote:
>
> Hello guys,
>
> First of all, this is my first post here. I think TW is a great piece of 
> tool, but since I am still beginner I would liek to ask you a question:
>

Hi Lukasz, 
Welcome to the club :)
 

>
> I would like to use tiddler's caption as a description of a link. I tried 
> two solutions, one works as expected, another one does not work. 
> Iw ould like to know why the other one does not work.
>
>
> SOLUTION 1 - this works as expected > creates link to MY_TIDDLER but 
> displays the caption of that tiddler
>
> <$link to="MY_TIDDLER"> {{MY_TIDDLER!!caption}} 
>

{{}} is the notation for a transclusion. see: 
http://tiddlywiki.com/#Transclusion and   
http://tiddlywiki.com/#Transclusion%20in%20WikiText
This is the convenience wikitext for the $transclude widget. ...
 

> SOLUTION 2 - this one does not work, WHY ? Instead the caption of 
> MY_TIDDLER it displays {{MY_TIDDLER!!caption}}
>
> [[{{MY_TIDDLER!!caption}}|MY_TIDDLER]]
>
 
see: http://tiddlywiki.com/#Linking%20in%20WikiText ... the above notation 
is a "pretty link". As you found out, it treats the first part in the 
brackets as the "pretty link" text. The transclusion {{}} is not evaluated. 
Only the text is used. So the [[]] notation is "just" a convenience 
function for the link widget. It makes it faster and easier to write but 
for some edge cases it is also limited. 

As you found out. For your behaviour you need the link widget, which  gives 
you maximum flexibility. 

To make your desired function easier to read and write, you can cover it 
into a macro. eg: 

\define myLink(tiddler tooltip:"")
  <$link to="""$tiddler$""" tooltip="""$tiddler$$tooltip$""">
<$transclude tiddler ="""$tiddler$""" field="caption">
  <$view tiddler ="""$tiddler$""" field="title"/>

  
\end

The above function is a bit more generic. It uses the tiddler title, if 
there is no caption field. 


You can use it with: <>   or  <>

lets say the tiddler named noCaption has no caption field. so the title is 
used
lets say the "tiddler has a caption field" has one so the caption is used. 
(sorry for the stupid names)

have fun!
mario

-- 
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 http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ec547096-64e9-4df2-92a5-7cb1647646b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.