\define makeurl(u) $u$$currentTiddler$
<$set name="url" value=<<makeurl "http://foo.com/#:">>>
...
</$set>\define makeurl(u) $u$$(currentTiddler)$
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="text"><<rev>></$view></$link>
</$set>
\endtiddler:MyTiddler
<<pub>>
<$set name="rev" value=<<concat {{!!creator}}>>>
\define concat() $(ThisCreator)$/$(currentTiddler)$
\define pub()
1 {{!!title}} 2 {{!!creator}} 3
<$set ThisCreator={{!!creator}}>
4 {{!!title}} 5 <<ThisCreator>> 6If 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?)
<$vars ThisCreator={{!!creator}}>...</$vars><$set name="ThisCreator" value={{!!creator}}>...</$set>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?
\define concat(str) $str$
<<concat "Hi my name is $(currentTiddler)$ I like TW $(version)$.">>$(…)$ The trick is to inject the whole macro body as string.
I know this is an old thread but I just wanted to add my solution.
\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">>
./text/Alice%2520in%2520Wonderland.tidHow would this be decoded? (Or am I just totally misunderstanding something?)
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?
...or maybe the different domain prevents this. Plus it no worky worky in Chrome.
...but hypothetically; the canonical_uri there is./text/Alice%2520in%2520Wonderland.tidHow would this be decoded? (Or am I just totally misunderstanding something?)
{{{ [[./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!
Ahaaa - very tricky! I would have never thought of it. I know I'll face this issue again - really valuable!
\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">>
\define concat(text,1,2,3,4,5,6,7,8,9,10) $text$
<<concat "Hello $1$. I am $(currentTiddler)$ in a TW $(version)$. Good bye $1$. Hope to see you again $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$
<<concat "Hello $1$. I am $(currentTiddler)$ in a TW $(version)$. Good bye $1$. Hope to see you again $1$." "foo">>
--
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.
To post to this group, send email to tiddl...@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.
Loved the trick, but it exhibits a parsing glitch when you try to put the variable values in bold using single quotes. Try <<concat "Hello $1$. I am ''$(currentTiddler)$'' in a TW $(version)$. Good bye $1$. Hope to see you again $1$." "foo">> for instance.
- 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+...@googlegroups.com.
To post to this group, send email to tiddl...@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.
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/.
<$macrocall $name="=" text="""I am ''$(currentTiddler)$ ''for TiddlyWiki $(version)$. This is rather $1$.""" 1="boldish"/>To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/CADeSwYPqqHwmi%2BJsen9zvcuEVb1XO76AYZL3EHWRiDbFU7fiVg%40mail.gmail.com.