Re: [tw] Re: Transclusion within a string

2014-11-17 Thread Tobias Beer


 Did you try to use $macrocall http://tiddlywiki.com/#MacroCallWidget? 


How exactly and why would that do the trick?

Best wishes, Tobias.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Transclusion within a string

2014-11-17 Thread Danielo Rodríguez

Because it allows things like this

$macrocall $name=themacro something={{!!title}}/

That is not possible with the normal call.

El lunes, 17 de noviembre de 2014 09:05:48 UTC+1, Tobias Beer escribió:

 Did you try to use $macrocall http://tiddlywiki.com/#MacroCallWidget? 


 How exactly and why would that do the trick?

 Best wishes, Tobias.


-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Transclusion within a string

2014-11-17 Thread Tobias Beer
Ok, so the actual code for Blake to use becomes...

$macrocall $name=concatenate string1=my string2={{!!title}}/

Correct?

I'd also be interested to know why widgets can use variables and evaluated 
bits and direct macro calls cannot.

Best wishes, Tobias.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Transclusion within a string

2014-11-17 Thread PMario
On Monday, November 17, 2014 11:39:16 AM UTC+1, Tobias Beer wrote:

 Ok, so the actual code for Blake to use becomes...

 $macrocall $name=concatenate string1=my string2={{!!title}}/

 Correct?


yes.
 


 I'd also be interested to know why widgets can use variables and 
 evaluated bits and direct macro calls cannot.


As I did understand Jeremy from other responses, its mainly a performance 
decision. 

-m 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Transclusion within a string

2014-11-17 Thread Jeremy Ruston

 I'd also be interested to know why widgets can use variables and
 evaluated bits and direct macro calls cannot.


 As I did understand Jeremy from other responses, its mainly a performance
 decision.


It's actually historical. The angle bracket syntax for macros was first
implemented early on, before transcluded attributes. Then as the widget
syntax evolved it was clear that it was more flexible and extensible.
Internally, everything is a widget, even plain text. All the wikitext
syntax beyond the widget syntax is really just a series of shortcuts for
more easily typing widgets and HTML. My expectation is that more and more
of the basic idioms that we discover as we explore the way that widgets fit
together will end up being elevated to wiki syntax. For example, we could
evolve a wikitext syntax for assigning variables that is terser than the
current $set widget.

Anyhow, the angle brackets syntax for macro invocation absolutely could
support transcluded parameters, and should probably be extended to do so.

Best wishes

Jeremy.




 -m




-- 
Jeremy Ruston
mailto:jeremy.rus...@gmail.com

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Transclusion within a string

2014-11-17 Thread Blake Blacksmith
Yes that is the working code. Sorry for not posting it I've been away from
my computer.


On Mon, Nov 17, 2014 at 5:39 AM, Tobias Beer beertob...@gmail.com wrote:

 Ok, so the actual code for Blake to use becomes...

 $macrocall $name=concatenate string1=my string2={{!!title}}/

 Correct?

 I'd also be interested to know why widgets can use variables and
 evaluated bits and direct macro calls cannot.

 Best wishes, Tobias.

 --
 You received this message because you are subscribed to a topic in the
 Google Groups TiddlyWiki group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/tiddlywiki/2_L_vTJ1Zbs/unsubscribe.
 To unsubscribe from this group and all its topics, 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.
 For more options, visit https://groups.google.com/d/optout.


-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Transclusion within a string

2014-11-16 Thread Danielo Rodríguez
Hello Blake ,

This has been discussed several times. You have to use a macro definition. 
Since I'm on my mobile I can't provide you an example but searching for 
concatenate in the forum should give you some results.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Transclusion within a string

2014-11-16 Thread PMario
see this post. IMO similar problem.
https://groups.google.com/d/msg/tiddlywiki/ChRV6sjQpn4/bCm35_XhGmkJ
-m

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Transclusion within a string

2014-11-16 Thread Blake Blacksmith


I am able to concatenate using a macro two strings for example:

\def concatenate(string 1:, string2:)

$string1$$string2$

\end

concatenate my _car

gives me: my_car

but when I use a transcluded text:

concatenate my {{!!text}}

I get: my{{!!text}} instead of the text field's string which is _car

Is there a way to convert a field to a usable string?

On Sunday, November 16, 2014 3:20:53 AM UTC-5, Danielo Rodríguez wrote:

 Hello Blake ,

 This has been discussed several times. You have to use a macro definition. 
 Since I'm on my mobile I can't provide you an example but searching for 
 concatenate in the forum should give you some results.


-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Transclusion within a string

2014-11-16 Thread Stephan Hradek


Am Sonntag, 16. November 2014 19:50:59 UTC+1 schrieb Blake Blacksmith:


 concatenate my {{!!text}}

Did you try to use $macrocall http://tiddlywiki.com/#MacroCallWidget? 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Transclusion within a string

2014-11-16 Thread Blake Blacksmith
No I did not and I think thats doing the trick. Thanks!

On Sun, Nov 16, 2014 at 2:23 PM, Stephan Hradek stephan.hra...@gmail.com
wrote:



 Am Sonntag, 16. November 2014 19:50:59 UTC+1 schrieb Blake Blacksmith:


 concatenate my {{!!text}}

 Did you try to use $macrocall http://tiddlywiki.com/#MacroCallWidget?

 --
 You received this message because you are subscribed to a topic in the
 Google Groups TiddlyWiki group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/tiddlywiki/2_L_vTJ1Zbs/unsubscribe.
 To unsubscribe from this group and all its topics, 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.
 For more options, visit https://groups.google.com/d/optout.


-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Transclusion within a string

2014-11-15 Thread Blake Blacksmith
What is the status of adding transcluded text into strings? I for instance 
need to transclude a title as part of the tag to search for in a filter.

I want to use the title of a tiddler to make a file path link so i have 
something that boils down to: [[Link|file:./root/{{!!title}}.pdf]] how can 
i get a string concatenation of file:./root/,{{!!title}}, and .pdf so 
that I can automatically link files to my tiddler based on its title? 


Another related instance, I have the filter: [tag[{{!!title}}]] and I want 
to make a list based on it but cannot currently with: $list filter=
[tag[{{!!title}}]]

-Blake

On Monday, February 3, 2014 3:41:02 PM UTC-5, Jeremy Ruston wrote:

 Hi Mike

 Going back to your original question, consider the example you gave:

 a href=mailto:$view field=emailclick to email/a

 At the moment, that doesn't work because the double quotes on the href 
 attribute cause the value to be interpreted as a literal string. The docs 
 point out that we also support quoting attribute values with double curly 
 braces (for transclusion) and double angle brackets (for macro invocations).

 We could also support a quote symbol that caused the attribute value to be 
 parsed as wikitext and rendered. For example, using quadruple round 
 brackets for illustration:

 a href=mailto:$view field=emailclick to email/a

 The reason originally that I didn't support something like that format is 
 because it felt like it led to overly complex symbol soup (which is a 
 frequent danger for TW5). I felt that the macro syntax offered a way to 
 simplify things by allowing the gobbledegook needed for the attribute value 
 to be packed up into a neat named macro definition.

 Anyhow, supporting element attributes in wikitext remains an option.

 Also, it's worth mentioning that TW5 will support global macros soon.

  Aaaah, this is maddening. It's so close.


 I'll try to work through the examples, but appreciate your feedback.
  

 Suppose I create a tiddler with the fields:
 x = mike
 email = {{!!x}}
 then, amazingly, 
 {{!!email}} displays mike


 Transclusion wikifies the transcluded tiddler field value.
  

 and, weirdly,
 a href={{!!emai}}link/a creates a link to {{!!x}}. hmm.


 Transcluding an element attribute value currently does not wikify the 
 transcluded tiddler field value.
  

 even weirder, changing the email field to be
 email = mailto:{{!!x}}
 then 
 {{!!email}} displays mailto:{{!!x}};
 and, weirdly,
 a href={{!!email}}link/a creates a link to mailto:{{!!x}};.


 Subtly, what's going on here is that TW5 is wikifying the text 
 mailto:{{!!x}};, and it sees the mailto:; part as the start of a mailto 
 URI. It treats the text up to the closing curly braces as part of the 
 literal mailto URI, and so never sees the transclusion.
  

 There is some crazy stuff going on between the TW parser and the 
 rendering engine that I'm not following.

   
 Hopefully that clarifies the present situation a little.

 I think we need to add ways to explicitly specify whether the target text 
 of a transclusion or macro invocation is to be wikified or not. There are 
 situations where both are required.

 Best wishes

 Jeremy




 On Mon, Feb 3, 2014 at 8:17 PM, Julie julie.st...@gmail.com javascript:
  wrote:

 Le lundi 3 février 2014 15:26:15 UTC+1, Mike a écrit :

 The $view widget claims it supports templates, but I couldn't get it 
 to work.


  Not really... the ViewWidget claims that it supports templates *with 
 certain formats*, and in the formats list only the date format seems to 
 work with a template.
  
 -- 
 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 javascript:.
 To post to this group, send email to tiddl...@googlegroups.com 
 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:jeremy...@gmail.com 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 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.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Transclusion within a string

2014-02-03 Thread Stephan Hradek
Does this help?

\define mailto(email link)
a href=mailto:$email$;$link$/a
\end

$macrocall $name=mailto email={{!!email}} link=mail me/


-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[tw] Re: Transclusion within a string

2014-02-03 Thread Mike
That sort of works, but ... 

1) I'd have to include / define that macro in every tiddler where i wanted 
to use it, right? Is there an easy way to put all my macros in one tiddler 
and then just include that into other tiddlers?

2) This seems like an incredibly long way to go around for what amounts to 
string concatenation. Suppose I want to generate a URL with a field value 
in the middle of it (versus at the end of it). I could attempt something 
like the following (sorry, I'm not sure how to post code blocks):

\define cc(a:,b:)
$a$$b$
\end

a href=cc cc http://google.com/#q=; xyz {{!!x}} link/a

Where cc is for CONCATENATE, but even that doesn't work because it doesn't 
properly process the nested macros. I guess using the full macrocall widget 
might work, but it's so long! Is there not a good way to just do substring 
insertion in general?

The $view widget claims it supports templates, but I couldn't get it to 
work.

On Monday, February 3, 2014 8:56:34 AM UTC-5, Stephan Hradek wrote:

 Does this help?

 \define mailto(email link)
 a href=mailto:$email$;$link$/a
 \end

 $macrocall $name=mailto email={{!!email}} link=mail me/




-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[tw] Re: Transclusion within a string

2014-02-03 Thread Mike
Aaaah, this is maddening. It's so close. Suppose I create a tiddler with 
the fields:
x = mike
email = {{!!x}}

then, amazingly, 
{{!!email}} displays mike
and, weirdly,
a href={{!!emai}}link/a creates a link to {{!!x}}. hmm.

even weirder, changing the email field to be
email = mailto:{{!!x}}

then 
{{!!email}} displays mailto:{{!!x}};
and, weirdly,
a href={{!!email}}link/a creates a link to mailto:{{!!x}};.

There is some crazy stuff going on between the TW parser and the rendering 
engine that I'm not following.


On Monday, February 3, 2014 8:40:25 AM UTC-5, Mike wrote:

 I'd like to have a field, e.g. email, and then use that field in a 
 string:

 a href=mailto:$view field=emailclick to email/a

 But the resulting link just goes to mailto:$view field=email. Any 
 ideas? I've also tried with the {{!!email}} notation, but it does the same 
 thing as soon as it's inside quotes. I don't really want to use a macro, 
 which seems much more heavy-weight than necessary. I also tried using

 $view field=email template=mailto:$value$;

 but (and maybe this is because I'm using 5.07beta) it seemed to completely 
 ignore the template parameter.

 Even if that last method could work it's syntactically heavy, so I'm 
 hoping there's some quirk or escape sequence to let me use {{}} right 
 inside the quoted string.

 Thanks!


-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[tw] Re: Transclusion within a string

2014-02-03 Thread Stephan Hradek


Am Montag, 3. Februar 2014 15:26:15 UTC+1 schrieb Mike:

 That sort of works, but ... 

 1) I'd have to include / define that macro in every tiddler where i wanted 
 to use it, right?


Right
 

 Is there an easy way to put all my macros in one tiddler and then just 
 include that into other tiddlers?


No

But you might want to create a javascript macro from it? Check 
http://tw5magick.tiddlyspot.com I show there the a simple example which 
might be sufficienent for you. I also have there a bookmarklet which can 
translate a normal TW5 macro to JavaScript. 


 2) This seems like an incredibly long way to go around for what amounts to 
 string concatenation



I agree 

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[tw] Re: Transclusion within a string

2014-02-03 Thread Stephan Hradek


Am Montag, 3. Februar 2014 15:26:15 UTC+1 schrieb Mike:

 That sort of works, but ...

 Another idea (Can be seen on http://skeeve.tiddlyspot.com check Mike's 
mail and mailto)

tiddler: Mike's Mail
email: m...@do.main
text: {{!!title||mailto}}

tiddler: mailto
text:

\define mailto(email)
a href=mailto:$email$;click to email/a
\end

$macrocall $name=mailto email={{!!email}}/


-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[tw] Re: Transclusion within a string

2014-02-03 Thread Julie
Le lundi 3 février 2014 15:26:15 UTC+1, Mike a écrit :

 The $view widget claims it supports templates, but I couldn't get it to 
 work.


 Not really... the ViewWidget claims that it supports templates *with 
certain formats*, and in the formats list only the date format seems to 
work with a template.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [tw] Re: Transclusion within a string

2014-02-03 Thread Jeremy Ruston
Hi Mike

Going back to your original question, consider the example you gave:

a href=mailto:$view field=emailclick to email/a

At the moment, that doesn't work because the double quotes on the href
attribute cause the value to be interpreted as a literal string. The docs
point out that we also support quoting attribute values with double curly
braces (for transclusion) and double angle brackets (for macro invocations).

We could also support a quote symbol that caused the attribute value to be
parsed as wikitext and rendered. For example, using quadruple round
brackets for illustration:

a href=mailto:$view field=emailclick to email/a

The reason originally that I didn't support something like that format is
because it felt like it led to overly complex symbol soup (which is a
frequent danger for TW5). I felt that the macro syntax offered a way to
simplify things by allowing the gobbledegook needed for the attribute value
to be packed up into a neat named macro definition.

Anyhow, supporting element attributes in wikitext remains an option.

Also, it's worth mentioning that TW5 will support global macros soon.

Aaaah, this is maddening. It's so close.


I'll try to work through the examples, but appreciate your feedback.


 Suppose I create a tiddler with the fields:
 x = mike
 email = {{!!x}}
 then, amazingly,
 {{!!email}} displays mike


Transclusion wikifies the transcluded tiddler field value.


 and, weirdly,
 a href={{!!emai}}link/a creates a link to {{!!x}}. hmm.


Transcluding an element attribute value currently does not wikify the
transcluded tiddler field value.


 even weirder, changing the email field to be
 email = mailto:{{!!x}}
 then
 {{!!email}} displays mailto:{{!!x}};
 and, weirdly,
 a href={{!!email}}link/a creates a link to mailto:{{!!x}};.


Subtly, what's going on here is that TW5 is wikifying the text
mailto:{{!!x}};,
and it sees the mailto:; part as the start of a mailto URI. It treats the
text up to the closing curly braces as part of the literal mailto URI, and
so never sees the transclusion.


 There is some crazy stuff going on between the TW parser and the rendering
 engine that I'm not following.


Hopefully that clarifies the present situation a little.

I think we need to add ways to explicitly specify whether the target text
of a transclusion or macro invocation is to be wikified or not. There are
situations where both are required.

Best wishes

Jeremy




On Mon, Feb 3, 2014 at 8:17 PM, Julie julie.strzele...@gmail.com wrote:

 Le lundi 3 février 2014 15:26:15 UTC+1, Mike a écrit :

 The $view widget claims it supports templates, but I couldn't get it to
 work.


  Not really... the ViewWidget claims that it supports templates *with
 certain formats*, and in the formats list only the date format seems to
 work with a template.

 --
 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.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
Jeremy Ruston
mailto:jeremy.rus...@gmail.com

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [tw] Re: Transclusion within a string

2014-02-03 Thread Mike
Yeah, functionality like you describe, with the quadruple round bracket, 
would be good for having the flexibility when needed.

I thought about it and I wonder if there's a way to just have the parser 
combine (string literal concatenation) sibling nodes of the parse tree when 
they're both string literals. That way both the string literal and the 
wikified transclusion would be mashed together. That way it could be:

a href=http://google.com/#q={{!!x}}link/a
becomes
a href=http://google.com/#q=value of field xlink/a
becomes
a href=http://google.com/#q=value of field xlink/a

As an alternative, would it be possible to add a layer of recursion so that 
any block which gets wikified is reparsed (and rewikified) until it doesn't 
change? That would probably create lots of side issues, but it would allow 
nesting of widgets, etc.

Thanks for your excellent response. I apologize if the questions or 
suggestions I have show my ignorance of how TW works under the hood.

-Mike

On Monday, February 3, 2014 3:41:02 PM UTC-5, Jeremy Ruston wrote:

 Hi Mike

 Going back to your original question, consider the example you gave:

 a href=mailto:$view field=emailclick to email/a

 At the moment, that doesn't work because the double quotes on the href 
 attribute cause the value to be interpreted as a literal string. The docs 
 point out that we also support quoting attribute values with double curly 
 braces (for transclusion) and double angle brackets (for macro invocations).

 We could also support a quote symbol that caused the attribute value to be 
 parsed as wikitext and rendered. For example, using quadruple round 
 brackets for illustration:

 a href=mailto:$view field=emailclick to email/a

 The reason originally that I didn't support something like that format is 
 because it felt like it led to overly complex symbol soup (which is a 
 frequent danger for TW5). I felt that the macro syntax offered a way to 
 simplify things by allowing the gobbledegook needed for the attribute value 
 to be packed up into a neat named macro definition.

 Anyhow, supporting element attributes in wikitext remains an option.

 Also, it's worth mentioning that TW5 will support global macros soon.

  Aaaah, this is maddening. It's so close.


 I'll try to work through the examples, but appreciate your feedback.
  

 Suppose I create a tiddler with the fields:
 x = mike
 email = {{!!x}}
 then, amazingly, 
 {{!!email}} displays mike


 Transclusion wikifies the transcluded tiddler field value.
  

 and, weirdly,
 a href={{!!emai}}link/a creates a link to {{!!x}}. hmm.


 Transcluding an element attribute value currently does not wikify the 
 transcluded tiddler field value.
  

 even weirder, changing the email field to be
 email = mailto:{{!!x}}
 then 
 {{!!email}} displays mailto:{{!!x}};
 and, weirdly,
 a href={{!!email}}link/a creates a link to mailto:{{!!x}};.


 Subtly, what's going on here is that TW5 is wikifying the text 
 mailto:{{!!x}};, and it sees the mailto:; part as the start of a mailto 
 URI. It treats the text up to the closing curly braces as part of the 
 literal mailto URI, and so never sees the transclusion.
  

 There is some crazy stuff going on between the TW parser and the 
 rendering engine that I'm not following.

   
 Hopefully that clarifies the present situation a little.

 I think we need to add ways to explicitly specify whether the target text 
 of a transclusion or macro invocation is to be wikified or not. There are 
 situations where both are required.

 Best wishes

 Jeremy




 On Mon, Feb 3, 2014 at 8:17 PM, Julie julie.st...@gmail.com javascript:
  wrote:

 Le lundi 3 février 2014 15:26:15 UTC+1, Mike a écrit :

 The $view widget claims it supports templates, but I couldn't get it 
 to work.


  Not really... the ViewWidget claims that it supports templates *with 
 certain formats*, and in the formats list only the date format seems to 
 work with a template.
  
 -- 
 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 javascript:.
 To post to this group, send email to tiddl...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/tiddlywiki.
 For more options, visit https://groups.google.com/groups/opt_out.




 -- 
 Jeremy Ruston
 mailto:jeremy...@gmail.com javascript:
  

On Monday, February 3, 2014 3:41:02 PM UTC-5, Jeremy Ruston wrote:

 Hi Mike

 Going back to your original question, consider the example you gave:

 a href=mailto:$view field=emailclick to email/a

 At the moment, that doesn't work because the double quotes on the href 
 attribute cause the value to be interpreted as a literal string. The docs 
 point out that we also support quoting attribute values with double curly 
 braces (for transclusion) and double angle brackets (for macro invocations).

 We could also support a 

Re: [tw] Re: Transclusion within a string

2014-02-03 Thread Mike
I was thinking more about it and tried something but I couldn't get it to 
work. I tried to update the $fields widget to have an extra parameter 
$fieldList and change exclude to be a boolean. That way you can specify a 
list of fields and whether you want ONLY those or all BUT those. This makes 
it super easy to take advantage of the existing $var$ replacement that the 
field widget does and pass a url or string in as a template. Something like 
this:

$ diff fields_orig.js fields.js 
45,46c45,46
 
 this.exclude = this.getAttribute(exclude);
---
 this.fieldList = this.getAttribute(fieldList);
 this.exclude = this.getAttribute(exclude,no) === yes;
51,53c51,53
 var exclude;
 if(this.exclude) {
 exclude = this.exclude.split( );
---
 var fieldList;
 if(this.fieldList) {
 fieldList = this.fieldList.split( );
55c55
 exclude = [text]; 
---
 fieldList = [text]; 
62c62,63
 if(exclude.indexOf(fieldName) === -1) {
---
 if((this.exclude  fieldList.indexOf(fieldName) === -1) ||
  (!!this.exclude  fieldList.indexOf(fieldName) !== -1)){
69c70,71
 if(exclude.indexOf(fieldName) === -1) {
---
 if((this.exclude  fieldList.indexOf(fieldName) === -1) ||
  (!!this.exclude  fieldList.indexOf(fieldName) !== -1)){



On Monday, February 3, 2014 3:41:02 PM UTC-5, Jeremy Ruston wrote:

 Hi Mike

 Going back to your original question, consider the example you gave:

 a href=mailto:$view field=emailclick to email/a

 At the moment, that doesn't work because the double quotes on the href 
 attribute cause the value to be interpreted as a literal string. The docs 
 point out that we also support quoting attribute values with double curly 
 braces (for transclusion) and double angle brackets (for macro invocations).

 We could also support a quote symbol that caused the attribute value to be 
 parsed as wikitext and rendered. For example, using quadruple round 
 brackets for illustration:

 a href=mailto:$view field=emailclick to email/a

 The reason originally that I didn't support something like that format is 
 because it felt like it led to overly complex symbol soup (which is a 
 frequent danger for TW5). I felt that the macro syntax offered a way to 
 simplify things by allowing the gobbledegook needed for the attribute value 
 to be packed up into a neat named macro definition.

 Anyhow, supporting element attributes in wikitext remains an option.

 Also, it's worth mentioning that TW5 will support global macros soon.

  Aaaah, this is maddening. It's so close.


 I'll try to work through the examples, but appreciate your feedback.
  

 Suppose I create a tiddler with the fields:
 x = mike
 email = {{!!x}}
 then, amazingly, 
 {{!!email}} displays mike


 Transclusion wikifies the transcluded tiddler field value.
  

 and, weirdly,
 a href={{!!emai}}link/a creates a link to {{!!x}}. hmm.


 Transcluding an element attribute value currently does not wikify the 
 transcluded tiddler field value.
  

 even weirder, changing the email field to be
 email = mailto:{{!!x}}
 then 
 {{!!email}} displays mailto:{{!!x}};
 and, weirdly,
 a href={{!!email}}link/a creates a link to mailto:{{!!x}};.


 Subtly, what's going on here is that TW5 is wikifying the text 
 mailto:{{!!x}};, and it sees the mailto:; part as the start of a mailto 
 URI. It treats the text up to the closing curly braces as part of the 
 literal mailto URI, and so never sees the transclusion.
  

 There is some crazy stuff going on between the TW parser and the 
 rendering engine that I'm not following.

   
 Hopefully that clarifies the present situation a little.

 I think we need to add ways to explicitly specify whether the target text 
 of a transclusion or macro invocation is to be wikified or not. There are 
 situations where both are required.

 Best wishes

 Jeremy




 On Mon, Feb 3, 2014 at 8:17 PM, Julie julie.st...@gmail.com javascript:
  wrote:

 Le lundi 3 février 2014 15:26:15 UTC+1, Mike a écrit :

 The $view widget claims it supports templates, but I couldn't get it 
 to work.


  Not really... the ViewWidget claims that it supports templates *with 
 certain formats*, and in the formats list only the date format seems to 
 work with a template.
  
 -- 
 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 javascript:.
 To post to this group, send email to tiddl...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/tiddlywiki.
 For more options, visit https://groups.google.com/groups/opt_out.




 -- 
 Jeremy Ruston
 mailto:jeremy...@gmail.com 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,