Re: [tw] Re: How combine string with evaluated value for a parameter value?

2016-01-13 Thread Felix Küppers
Hi Xavier.

I agree, strange indeed. Maybe raise an issue at the TW GitHub repo?

-Felix

On 01/12/2016 05:31 PM, Xavier Cazin wrote:
> Hi everyone,
>
> Loved the trick, but it exhibits a parsing glitch when you try to put
> the variable values in bold
> ​ using single quotes​
> . Try < ​$'​
> ' in a TW $(version)$. Good bye $1$. Hope to see you again $1$."
> "foo">> for instance.
>
> X.
>
> -- Xavier Cazin
>
> On Tue, Jan 12, 2016 at 5:18 PM, Tobias Beer  > wrote:
>
> Hi Felix,
>
> Ha! Nice @Tobias, didn't think of this. Now we almost got the
> equivalent to "printf"
> (https://en.wikipedia.org/wiki/Printf_format_string) :D 
>
>  
>
> |\define concat(text,1,2,3,4,5,6,7,8,9,10) $text$
>  
> || < $(version)$. Good bye $1$. Hope to see you again $1$." "foo">>|
>
>
> I added the above here:
>
> Ad-Hoc Macro @ tb5 
>
> Thanks again. That's some nifty-cool stuff.
>
> 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 https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit
> 
> https://groups.google.com/d/msgid/tiddlywiki/b7fffef4-505a-4b64-9b3b-7e79bd51bae7%40googlegroups.com
> 
> .
>
>
> 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 https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/CADeSwYPqqHwmi%2BJsen9zvcuEVb1XO76AYZL3EHWRiDbFU7fiVg%40mail.gmail.com
> .
> 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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/BLU436-SMTP21786B5494509C76F8C3CD0CECB0%40phx.gbl.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: How combine string with evaluated value for a parameter value?

2016-01-13 Thread Felix Küppers

>
> Ad-Hoc Macro @ tb5 
>

+1

-- 
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/BLU437-SMTP27392924A4BC435082876ACECB0%40phx.gbl.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: How combine string with evaluated value for a parameter value?

2016-01-12 Thread Tobias Beer
 Hi Xavier,
 

> Loved the trick, but it exhibits a parsing glitch when you try to put the 
> variable values in bold
> ​ using single quotes​
> . Try < ​$'​
> ' in a TW $(version)$. Good bye $1$. Hope to see you again $1$." "foo">> 
> for instance.
>

Two options to go about it:

   1. you can always use single quotes instead
   2. use triple double-quotes to allow single-double within

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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5f172210-c97b-4fda-b8d6-8eff475fd971%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: How combine string with evaluated value for a parameter value?

2016-01-12 Thread Xavier Cazin
Hi Tobias,

This is not really a matter of quote parsing but rather of wikitext
parsing. Try <$macrocall $name="=" text="""I am ''$(currentTiddler)$'' for
TiddlyWiki $(version)$. This is rather $1$.""" 1="boldish"/> somewhere in
http://tobibeer.github.io/tb5/.

X.

-- Xavier Cazin

On Tue, Jan 12, 2016 at 5:57 PM, Tobias Beer  wrote:

>  Hi Xavier,
>
>
>> Loved the trick, but it exhibits a parsing glitch when you try to put the
>> variable values in bold
>> ​ using single quotes​
>> . Try <> ​$'​
>> ' in a TW $(version)$. Good bye $1$. Hope to see you again $1$." "foo">>
>> for instance.
>>
>
> Two options to go about it:
>
>1. you can always use single quotes instead
>2. use triple double-quotes to allow single-double within
>
> 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 https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/5f172210-c97b-4fda-b8d6-8eff475fd971%40googlegroups.com
> 
> .
>
> 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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CADeSwYPvRVy3dOeU_6ewJnpoPFUB9dYOe1afaJE0zM3%3DViz2jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: How combine string with evaluated value for a parameter value?

2016-01-12 Thread Xavier Cazin
Hi everyone,

Loved the trick, but it exhibits a parsing glitch when you try to put the
variable values in bold
​ using single quotes​
. Try <>
for instance.

X.

-- Xavier Cazin

On Tue, Jan 12, 2016 at 5:18 PM, Tobias Beer  wrote:

> Hi Felix,
>
> Ha! Nice @Tobias, didn't think of this. Now we almost got the equivalent
>> to "printf" (https://en.wikipedia.org/wiki/Printf_format_string) :D
>
>
>
> \define concat(text,1,2,3,4,5,6,7,8,9,10) $text$
>>
>>  <> bye $1$. Hope to see you again $1$." "foo">>
>>
>
> I added the above here:
>
> Ad-Hoc Macro @ tb5 
>
> Thanks again. That's some nifty-cool stuff.
>
> 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 https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/b7fffef4-505a-4b64-9b3b-7e79bd51bae7%40googlegroups.com
> 
> .
>
> 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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CADeSwYPqqHwmi%2BJsen9zvcuEVb1XO76AYZL3EHWRiDbFU7fiVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2016-01-12 Thread Tobias Beer
Hi Felix,

Ha! Nice @Tobias, didn't think of this. Now we almost got the equivalent to 
> "printf" (https://en.wikipedia.org/wiki/Printf_format_string) :D 

 

\define concat(text,1,2,3,4,5,6,7,8,9,10) $text$
>  
>  < bye $1$. Hope to see you again $1$." "foo">>
>

I added the above here:

Ad-Hoc Macro @ tb5 

Thanks again. That's some nifty-cool stuff.

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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b7fffef4-505a-4b64-9b3b-7e79bd51bae7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: How combine string with evaluated value for a parameter value?

2016-01-12 Thread Tobias Beer
 Hi again, Xavier,
 

> This is not really a matter of quote parsing but rather of wikitext 
> parsing. Try <$macrocall $name="=" text="""I am ''$(currentTiddler)$'' for 
> TiddlyWiki $(version)$. This is rather $1$.""" 1="boldish"/> somewhere in 
> http://tobibeer.github.io/tb5/.
>
>
Mhhh, not sure what's going on here, I would consider this a core bug. 

It's got something to do with the sequence *$''*, or just *$'* because this 
works:

<$macrocall $name="=" text="""I am ''$(currentTiddler)$ ''for TiddlyWiki 
$(version)$. This is rather $1$.""" 1="boldish"/>

Notice the space before the closing single-quotes.

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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d5193c51-5e57-491a-93ca-fe4cd4dd2e7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: How combine string with evaluated value for a parameter value?

2016-01-01 Thread Felix Küppers
Hi Matabele

> Really useful trick :-) Many thanks for this.

Thanks, sometimes really handy.

-- 
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/BLU436-SMTP64C879389ECBA1D89688B1CEFF0%40phx.gbl.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2016-01-01 Thread Felix Küppers

>
> Ahaaa - very tricky! I would have never thought of it. I know I'll face 
> this issue again - really valuable!
>

Thanks @Mat

\define =(text,1,2,3,4,5,6,7,8,9,10) $text$

<<= "I am $(currentTiddler)$ in a TW $(version)$. And here is $1$." "foo">>

Ha! Nice @Tobias, didn't think of this. Now we almost got the equivalent to 
"printf" (https://en.wikipedia.org/wiki/Printf_format_string) :D

\define concat(text,1,2,3,4,5,6,7,8,9,10) $text$
 <>

-- 
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/816ce6bd-7c2f-4ab2-9aa3-91c455832c8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2016-01-01 Thread Mat
My goodness! @Felix, to pick up on this old issue is very kind of you! And 
it seems to have really started a flow of useful solutions. Wow!

*The trick is to inject the whole macro body as string.*
>

Ahaaa - very tricky! I would have never thought of it. I know I'll face 
this issue again - really valuable!

Thank you Felix!

<:-)

-- 
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/28d79914-de9e-4243-9f46-e3218273b1d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2016-01-01 Thread Tobias Beer
Hi Felix,
 

> I know this is an old thread but I just wanted to add my solution.
>

Wow. This is something to ponder:

\define =(text,1,2,3,4,5,6,7,8,9,10) $text$

<<= "I am $(currentTiddler)$ in a TW $(version)$. And here is $1$." "foo">>

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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/61f90332-4fe1-43e1-9263-3cd79c3d0ce0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2016-01-01 Thread Mat
Tobias, thank you!

Setvars is really, really cool!

That's really interesting how vars are called *already in* the setting of 
the other vars!

<:-)


On Wednesday, December 30, 2015 at 2:06:30 PM UTC+1, Tobias Beer wrote:
>
> Hi Mat,
>
> You can easily achieve that using tobibeer/setvars 
> :
>
> <$setvars url="\http://tiddlywiki.com/#\ current" _current=<
> >>
> <>
> 
>
> However, this requires for the tiddler title to not have spaces in order 
> for the link to work with a TiddlyWiki.
>
> While not officially released, here's a little macro module called *x* 
> that does what you want,
> by default pointing to http://tiddlywiki.com:
>
> $:/.tb/modules/macros/x.js 
> 
>  (*code:* tobibeer/tw5-defaults/.../x.js 
> 
> )
>
> *syntax:*
>
>- <>
>- <>
>- <>
>
> If you want it to point to another domain, simply create a global macro 
> called *x-url* and have it return your *base-url*, e.g.:
>
> title: $:/config/x-url
> tags: $:/tags/Macro
>
> \define x-url()
> http://tobibeer.github.io/tw5-plugins
> \end
>
> Alternatively, you can, of course overwrite the *x-url* for each tiddler 
> individually by declaring it at the start:
>
> \define x-url() http://tobibeer.github.io/tw5-plugins
>
> 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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8022679a-5b69-4e6a-ae89-182a786374e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2016-01-01 Thread Mat
Tobias,

you may be interested in the new tobibeer/hash 
>  filter plugin (announced 
> here 
> 
> ),
>

Again my warmest thanks to you!

Just to make sure I get it right, this is only for cases using URI, right?

In your examples given there to decode... I can't quite tell what is 
supposedly encoded? Do you think you could refer to the external tiddlers 
example  from 
tiddlywiki.com/prerelease? ...or maybe the the different domain prevents 
this. Plus it no worky worky in Chrome. ...but hypothetically; the 
canonical_uri there is 

./text/Alice%2520in%2520Wonderland.tid

How would this be decoded? (Or am I just totally misunderstanding something?) 


Again, thanks Tobias! You're creating amazing things - and to say you're 
generously sharing is a definite understatement!

<:-)

-- 
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/4c6578e4-9b0e-4987-ad27-cc55a0914dec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2016-01-01 Thread Tobias Beer
Hi Mat,
 

> Just to make sure I get it right, this is only for cases using URI, right?
>

Try to create a permalink for a tiddler containing spaces, or even a 
permaview for multiple tiddlers, including those containing spaces. You'll 
see that you cannot just create the proper link solely with a given title, 
but that it needs to be uri-encoded, so TiddlyWiki knows how to read out 
the contents of the address bar.

In your examples given there to decode... I can't quite tell what is 
> supposedly encoded?
>

The decoding examples are pretty straight forward: First I use the hash 
filter to encode a title, and right after that use it again with the decode 
suffix to decode them back. So, in a way I am proving that, in the end, you 
get back what you started out with. Makes sense?

I could have just taken any cryptic url, but then others may not have 
understood what that url is and why the hash filter does its decoding the 
way it does it. By showing that decoding is simply doing the reverse of 
encoding, I figured, it would be pretty clear what's going on.
 

> Do you think you could refer to the external tiddlers example 
> 
>  
> from tiddlywiki.com/prerelease?
>

What do you mean by that?

...or maybe the different domain prevents this. Plus it no worky worky in 
> Chrome.
>

To be able to create a properly encoded link to any external TiddlyWiki is 
precisely what the *hash* filter is intended for. Simply give it the 
un-encoded title either as an input title or via the operand and it will 
create the proper uri-encoded link for you... but you will have to add the 
proper domain yourself using the *addprefix* operator.
 

> ...but hypothetically; the canonical_uri there is 
>
> ./text/Alice%2520in%2520Wonderland.tid
>
> How would this be decoded? (Or am I just totally misunderstanding something?)
>
>
The problem with these links is that they are DOUBLE uri encoded, for 
reasons I have not quite grasped yet ...so you actually need to decode them 
twice to have them fully decoded:

{{{ [[./text/Alice%2520in%2520Wonderland.tid]hash:decode[]hash:decode[]] }}}

Again, thanks Tobias! You're creating amazing things - and to say you're 
generously sharing is a definite understatement!
>
>
Thanks, Mat... and ...you're welcome. :-)

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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/bd33a983-1afb-487e-a831-87639520c261%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2015-12-31 Thread Tobias Beer
Hi Mat,

you may be interested in the new tobibeer/hash 
 filter plugin (announced here 

),
which allows to uri-encode one or more tiddler titles to proper uri hashes.

Especially the syntax-example for generating a full url may be of interest 
to you:

http://tobibeer.github.io/tw5-plugins/#hash-Syntax

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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8712e6f7-3ffe-4b4d-a5be-b774675b2606%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2015-12-30 Thread Matabele
Hi Felix

Really useful trick :-) Many thanks for this.

regards

On Wednesday, 30 December 2015 14:44:56 UTC+2, Felix Küppers wrote:
>
> Hi Mat, 
>
> I know this is an old thread but I just wanted to add my solution.
>
> If you only want to concatenate variables, macros and literals (but no 
> transclusions), you can use the following technique, which allows you to 
> dynamically concatenate strings without having to specifiy the 
> concatination in the concat macro itself:
>
> \define concat(str) $str$
>
 

> <>
>
>

-- 
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/a6495699-3662-4d60-9191-72fb08e6b686%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2015-12-30 Thread Felix Küppers
Hi Mat, 

I know this is an old thread but I just wanted to add my solution.

If you only want to concatenate variables, macros and literals (but no 
transclusions), you can use the following technique, which allows you to 
dynamically concatenate strings without having to specifiy the 
concatination in the concat macro itself:

\define concat(str) $str$

<>

This technique makes use of TW's ability to parameterize variable calls.

*The trick is to inject the whole macro body as string.*

So we refer to variables and macros via

$(…)$ 

notation and embedd everything in a single string that is then passed to 
the concat macro as param. This has a huge advantage over hardcoding the 
macro body.

<$set name="url" value=
:$(currentTiddler)$">>>
<$set name="url" value=:$(currentTiddler)$ 
Hello world $(version)$">>>

You see the advantage? you can use the same single concat macro for several 
dynamic concatination tasks

-Felix

-- 
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/e0b361fc-8949-418e-9eb5-63b7d500d25b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2015-12-30 Thread Tobias Beer
Hi Mat,

You can easily achieve that using tobibeer/setvars 
:

<$setvars url="\http://tiddlywiki.com/#\ current" _current=<
>>
<>


However, this requires for the tiddler title to not have spaces in order 
for the link to work with a TiddlyWiki.

While not officially released, here's a little macro module called *x* that 
does what you want,
by default pointing to http://tiddlywiki.com:

$:/.tb/modules/macros/x.js 

 (*code:* tobibeer/tw5-defaults/.../x.js 

)

If you want it to point to another domain, simply create a global macro 
called *x-url* and have it return your *base-url*, e.g.:

title: $:/config/x-url
tags: $:/tags/Macro

\define x-url()
http://tobibeer.github.io/tw5-plugins
\end

Alternatively, you can, of course overwrite the *x-url* for each tiddler 
individually by declaring it at the start:

\define x-url() http://tobibeer.github.io/tw5-plugins

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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/c95281a6-b989-4877-b8b9-0cd91a05baa6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2015-07-23 Thread Eric Shulman
On Thursday, July 23, 2015 at 2:51:17 AM UTC-7, Mat wrote:

 If you don't mind me asking - how did you figure out it should use a vars 
 instead of a set? !!creator looks very non-variablish to me? (...and what 
 would have happened pre-5.1.9 when there was no vars widget?)


Anything you can define with $vars can also be defined individually using 
$set.  $vars is merely a more compact syntax for defining multiple 
variables at once.  Thus, instead of writing:

$vars ThisCreator={{!!creator}}.../$vars

you could simply write:

$set name=ThisCreator value={{!!creator}}.../$set


Note that in this particular use case, the second variable (rev) has to 
be set using a separate widget, because it's value depends on already 
having ThisCreator defined.

-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 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/d2973787-3208-4224-ad9d-ecddd2f494ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2015-07-23 Thread Eric Shulman
On Thursday, July 23, 2015 at 9:26:04 AM UTC-7, Mat wrote:

 Ah, thanks @Eric! Truly an easy syntactic mistake to make.

 As far as I can tell, $vars thus makes $set superfluous. Do you happen to 
 know why wasn't $set just enhanced instead of introducing also $vars? Would 
 enhancing $set break backward compatability?


see http://tiddlywiki.com/#VarsWidget, in which Jeremy wrote:
-
It should be noted that this widget differs from the set widget in the 
following ways:
* A fallback (also known as emptyValue) cannot be specified
* Filters cannot be used to produce a conditional variable assignment
* Variable names must be literal strings 
-

Thus, while $set and $vars are very similar, they are not 100% 
equivalent... and yes, I think $set was left as-is because of 
backward-compatibility issues.

-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 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/43c6adfb-fa67-4aa8-bca5-10f69859ed19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2015-07-23 Thread Mat
Ah, thanks @Eric! Truly an easy syntactic mistake to make.

As far as I can tell, $vars thus makes $set superfluous. Do you happen to 
know why wasn't $set just enhanced instead of introducing also $vars? Would 
enhancing $set break backward compatability?

Thanx

:-)

-- 
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/a9069eb3-44e2-45ca-970a-c80a2ed330dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2015-07-23 Thread Mat
That did it! Excellent Jed! :-D

If you don't mind me asking - how did you figure out it should use a vars 
instead of a set? !!creator looks very non-variablish to me? (...and what 
would have happened pre-5.1.9 when there was no vars widget?)

:-)

-- 
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/caae0262-4831-4f95-8216-56914460fb53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2015-07-22 Thread Eric Shulman
On Wednesday, July 22, 2015 at 7:35:10 AM UTC-7, Mat wrote:

 How does one concatenate a string and a calculated value (e.g a macro or a 
 transclusion)?

 For example this doesn't work:

 $set name=url value=http://foo.com/#:;currentTiddler

 $set name=url value=http://foo.com/#:currentTiddler

 $set name=url value=http://foo.com/#:currentTiddler


 Doc on the setwidget http://tiddlywiki.com/#SetWidgetdoesn't make this 
 clear. Nor does other places (ex 
 http://tobibeer.github.io/tb5/#Variables%20vs.%20Parameters). The issue 
 is of course not specific for the setwidget but it is a bit ironic 
 specifically for the setwidget as this, from what I understand, is used for 
 avoiding these difficulties.


The $set widget only *stores* the value specified, it doesn't know how to 
assemble values from individual parts.  That's what macros are for: 
assembling and returning compound text strings.

To accomplish your goal, you can define a macro to concatenate the current 
tiddler title to the end of the string, and then assign the result using 
the $set widget.

Something like this:
\define makeurl(u) $u$$currentTiddler$
$set name=url value=makeurl http://foo.com/#:;
...
/$set

-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 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/a7be2558-acaf-407c-a447-81bf4dc34af6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2015-07-22 Thread Eric Shulman
correction:

currentTiddler is a variable, not a macro parameter.  Thus, instead of 
$currentTiddler$ it should be $(currentTiddler)$

like this:

 \define makeurl(u) $u$$(currentTiddler)$
 $set name=url value=makeurl http://foo.com/#:;
 ...
 /$set


-- 
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/910f2e93-b7f1-4377-95a5-794c7b7f8c5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2015-07-22 Thread Jed Carty
If you want some more examples I have some here 
http://inmysocks.tiddlyspot.com/#Concatenating%20text%20to%20make%20dynamic%20URLs

-- 
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/d6ba7ce7-1e1e-42f4-848a-74ac34532f1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2015-07-22 Thread Jed Carty
The problem is 

$set name=rev value=concat {{!!creator}}

The input to the macro isn't wikified before the macro is evaluated in this 
context. Use this instead:

\define concat() $(ThisCreator)$/$(currentTiddler)$

\define pub()
$set ThisCreator={{!!creator}}
$set name=rev value=concat
$link to=rev$view tiddler=rev field=title 
format=textrev/$view/$link
/$set
/$set
\end

pub

-- 
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/6d76b684-45e8-443d-9303-a8d2e3b1f3da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2015-07-22 Thread Mat
Thanks for superfast reply, Jed!

...but no luck. Merely adding some tests to your code, see below, gives 
this (non-)result:

1 MyTid 2 Mat 3 4 5 6

\define concat() $(ThisCreator)$/$(currentTiddler)$

\define pub()
1 {{!!title}} 2 {{!!creator}} 3
$set ThisCreator={{!!creator}}
4 {{!!title}} 5 ThisCreator 6
$set name=rev value=concat

$link to=rev$view tiddler=rev field=title format=textrev
/$view/$link
/$set
/$set
\end


-- 
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/54de5806-fdf2-4df8-9b1d-5b61b322e0c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2015-07-22 Thread Mat
@Eric, @Jed - I appreciate your help!!!

However... I just can't get it to work, in spite of your multiple examples. 
Below is the more actual code. 

The idea is to display the current tiddlers title but with the tiddlers 
creators name prepended to it, so the title Foo BarFrotz display as Bob/Foo 
BarFrotz
(My odd choice for title is to make it clear that the camelcased word 
becomes a part of the full link via that longest code line below, see #1880 
https://github.com/Jermolene/TiddlyWiki5/issues/1880. Not an issue for 
this thread though.)  

With your help, the $(currentTiddler)$ bit works, but the $creator$ part is 
problematic. My general question there is how do I get field data? I've 
tried with all variants I can think of. If possible, I would rather call 
the concat macro with the tiddler (i.e {{!!title}}) than with !!creator, so 
that I could extract other field data.

In the second tiddler, I don't include any argument for the pub 
macrocall because using {{!!title}} in the macros work and so I figure 
{{!!creator}} should work to. Right? (I've of course tried the other way 
too.)

Ok, help appreciated. 


tiddler: MyMacros
tags: $:/tags/Macro

\define concat(creator) $creator$/$(currentTiddler)$

\define pub()
$set name=rev value=concat {{!!creator}}
$link to=rev$view tiddler=rev field=title format=textrev
/$view/$link
/$set
\end

and

tiddler:MyTiddler

pub


-- 
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/130f9361-34e7-4e76-b63a-b0c99fc9c9cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: How combine string with evaluated value for a parameter value?

2015-07-22 Thread Jed Carty
After a few minutes of some rather intense confusion I realized that I used 
the vars instead of set for the first definition when testing and wrote set 
when I put it in my answer to you. Sorry about that.

This time here is exactly what I have in the tiddler I am testing with on 
tiddlywiki.com:

\define concat() $(ThisCreator)$/$(currentTiddler)$

\define pub()
1 {{!!title}} 2 {{!!creator}} 3
$vars ThisCreator={{!!creator}}
4 {{!!title}} 5 ThisCreator 6

$set name=rev value=concat

$link to=rev$view tiddler=rev field=title 
format=textrev/$view/$link
/$set
/$vars
\end

pub

-- 
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/54112d3a-d960-4200-b3db-5b3cf36b3349%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.