On Thursday, February 27, 2014 11:26:00 PM UTC-8, RunningUtes wrote:
>
> I would like to do the same thing in TW5, but it seems that I have to use 
> \define and \end for this. So far I have:
> \define QR(text)
> <img src="http://chart.apis.google.com/chart?chs=150x150&cht=qr&chl=$text$
> ">
> \end
> but am not sure how to access the QR. <<QR "hello world">>?
>

Yes.  Exactly.  You are correct.
   <<QR "hello world">>
will use the order of the *unnamed* parameter value to match up with the 
parameter name(s) in the macro (e.g., "text").

You can also use *named* parameters:
   <<QR text:"hello world">>
which ensures that the value is assigned to the matching named parameter in 
the macro

For example, suppose you want to specify the content AND *optionally* the 
size of the QR code.  Your macro could be written as:
\define QR(text,size:150)
<img src="
http://chart.apis.google.com/chart?chs=$size$x$size$&cht=qr&chl=$text$<http://chart.apis.google.com/chart?chs=150x150&cht=qr&chl=$text$>
">
\end
and then used by writing, for example, any of these variations:
<<QR "...">>
<<QR "..." 100>>
<<QR text:"..." 100>>
<<QR size:100 text:"...">>

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
   http://TiddlyTools.github.com/fundraising.html#MakeADonation

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
   http://www.TiddlyTools.com/#Contact



-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to