Try again:
\define stamp() $(old)$ <hr> At $(nows)$ <br> $(add)$
\define appendButton(old,add)
<$vars old="""$old$""" add="""$add$""" nows=<<now>>>
<$button set="Log1" setTo=<<stamp>>> add to log</$button>
</$vars>
\end
-- Mark
On Wednesday, January 2, 2019 at 11:32:06 AM UTC-8, Joe Armstrong wrote:
>
> UUm - this didn't work for me - the <hr> and <br> vanish without a trace
> <<now>> is expanded correctly
>
> ?????
>
> /Joe
>
>
>
> On Wednesday, 2 January 2019 19:32:51 UTC+1, Mark S. wrote:
>>
>> Wikitext doesn't get rendered between strings. The exception is wikitext
>> inside of a wikify widget, which gets rendered sometimes on Wednesdays.
>>
>> This worked in my test:
>>
>> \define appendButton(old,add)
>> <$wikify name="stamp" text="$old$ <hr> At <<now>> <br> $add$">
>> <$button set="Log1" setTo=<<stamp>>> add to log</$button>
>> </$wikify>
>> \end
>>
>> HTH
>> -- Mark
>>
>>
>> On Wednesday, January 2, 2019 at 10:28:34 AM UTC-7, Joe Armstrong wrote:
>>>
>>> I have made a tiddler called [[Log1]] this is
>>> supposed to be a log file.
>>>
>>>
>>> I have a second tiddler [[AddToLog]] which is supposed to add a
>>> time-stamped entry to the end of the log.
>>>
>>> It has a little text box to enter text with and a button
>>>
>>> AddToLog is like this:
>>>
>>>
>>> \define appendButton(old,add)
>>> <$button set="Log1" setTo="$old$ <hr> At <<now>> <br> $add$"> add
>>> to log</$button>
>>> \end
>>>
>>> <$edit-text tiddler="$:/temp/Append"/>
>>> <$macrocall $name="appendButton" old={{Log1}}
>>> add={{$:/temp/Append}}/>
>>>
>>> If I run the code in this tiddler ut some text in the edit button and
>>> click
>>> on 'add to log' the log gets appended with this:
>>>
>>> <hr>
>>> At <<now>> <br> .. the text I entered ...
>>>
>>> Which is wrong since I want <<now>> to be now (ie something like
>>> 2019-01-02 ...) and NOT <<now>>
>>>
>>> I have tried many ways to program my way around this but they all fail.
>>>
>>> So how can I get the value of <<now>> now?
>>>
>>> I need to turn off the lazy evaluation.
>>>
>>> Cheers
>>>
>>> /Joe
>>>
>>>
>>>
--
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/c112af20-a5f8-4c10-b51b-542c6506c064%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.