Hi Ken,

Sorry, too fast I started with a red macro and forgot to rename the "red" 
macro to "clr" macro.

Here the revised version:

Create a macro tiddler, tagged with $:/tags/Macro, containing:

\define clr(color,text)
@@color:$color$;
$text$
@@
\end

and use it like this:

<<clr "red" "This is red">>

Cheers,

Ton


On Tuesday, August 19, 2014 8:34:14 PM UTC+2, Ken Gray wrote:
>
> that's perfect!!!  however, I'm getting 'illegal character' JS error.  did 
> it mess up your copy/paste?
>
> On Tuesday, August 19, 2014 1:23:10 PM UTC-5, Ton Gerner wrote:
>>
>> Hi Ken,
>>
>> Why not do it in WikiText?
>>
>> Create a macro tiddler, tagged with $:/tags/Macro, containing:
>>
>> \define red(color,text)
>> @@color:$color$;
>> $text$
>> @@
>> \end
>>
>> and use it like this:
>>
>> <<clr "red" "This is red">>
>>
>> Cheers,
>>
>> Ton
>>
>> On Tuesday, August 19, 2014 5:44:38 PM UTC+2, Ken Gray wrote:
>>>
>>> I was doing some work with Danielo Rodríguez's work with the rojo macro 
>>> and since it's pretty easy to build a bunch of scripts for a bunch of 
>>> different colours, couldnt we modify this to pass along colour as a 
>>> parameter?  
>>> here's his rojo code and how it's called.
>>>
>>> <<rojo "text to put in red color">>
>>>
>>>
>>>
>>>
>>> /*\
>>> title: $:/macros/skeeve/rojo.js
>>> type: application/javascript
>>> module-type: macro
>>>
>>> \*/
>>> (function(){
>>>
>>> /*jslint node: true, browser: true */
>>> /*global $tw: false */
>>> "use strict";
>>>
>>> /*
>>> Information about this macro
>>> This is developed to put some text in red.
>>> */
>>>
>>> exports.name = "rojo";
>>>
>>> exports.params = [
>>>         { name: "textToColorize" }
>>> ];
>>>
>>> /*
>>> Run the macro
>>> */
>>> exports.run = function(textToColorize) {
>>>         if( !textToColorize) textToColorize = "IMPORTANT";
>>>                 return spanize(textToColorize,"red");
>>>     
>>>     function spanize(texto,color){
>>>         return "<span style='color:" + color + "'>" + texto + "</span>";
>>>     }
>>>
>>> };
>>>
>>> })();
>>>
>>>
>>>
>>>

-- 
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.

Reply via email to