[tw] Re: Condition: An if-else plugin for wikitext

2018-02-02 Thread Diego Mesa
Hey Evan, <$if value="(=gt(2,3)=)"> yes <$else> no > Qualifying the last message because I spoke a bit too quickly and don't > want to be blithe: > > TiddlyWiki doesn't do nested string expressions, macros notwithstanding, > and Jeremy has suggested that the current design forces too much depe

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-30 Thread Evan Balster
Qualifying the last message because I spoke a bit too quickly and don't want to be blithe: TiddlyWiki doesn't do nested string expressions, macros notwithstanding, and Jeremy has suggested that the current design forces too much dependence on macros. That's a motivator for my work on the formu

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-30 Thread Evan Balster
Honestly, stuff like that is why I'm making the formula widget. TiddlyWiki doesn't do nested expressions, formula does. The only missing piece is a transclude function accepting a string (or a family of these...). On Saturday, 30 December 2017 16:46:54 UTC-6, coda coder wrote: > > > > On Satur

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-30 Thread coda coder
On Saturday, December 30, 2017 at 4:28:12 PM UTC-6, Evan Balster wrote: > > Oh, wait, sorry, shoot. That won't work at all, it'll just expand to the > string of the transclusion. > Right. And why I said (wished) $if accepting a TextReference (like state does for $reveal). I'm hinting that i

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-30 Thread Evan Balster
OK, so this is a classic case of "TiddlyWiki macro expansion is confusing as heck". You can't put a <> (or variable) inside a {{transclusion}}, either in WikiText or in attributes. You *can* expand specific variables inside macros, but it uses a dollar sign syntax. In your case, just move the

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-30 Thread Evan Balster
Oh, wait, sorry, shoot. That won't work at all, it'll just expand to the string of the transclusion. Yeah, you're going to have to set another variable, or use <$tiddler> or something. On Saturday, 30 December 2017 16:27:12 UTC-6, Evan Balster wrote: > > OK, so this is a classic case of "Tiddl

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-30 Thread coda coder
Thanks Evan... I did wonder about that, too. So, do you think this should work? (I'm trying to keep to a minimum the alien code you need to digest :) Original: <$reveal type="nomatch" state=<> text="show"> $if: <$if not value={{<>}} match="show"> \define get-note-state() $:/temp/state/$(curr

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-30 Thread Evan Balster
Hey, Coda — The substitution in your example there *should* work fine, so I suspect the trouble lies elsewhere. For example, this works: \define testSearchBar(field) <$if value={{$:/temp/search!!$field$}} match="yes"> Search is "yes" \end <> Remember that a macro can't define *only* the open

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-30 Thread coda coder
Hi Evan... On Friday, December 29, 2017 at 11:54:54 PM UTC-6, Evan Balster wrote: > > > As compared with the closely-related *$reveal* widget, conditions are > simpler, behave more like *$list*, and can be executed as a chain. They > don't retain contents or animate, and can be based on variabl

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-30 Thread coda coder
On Saturday, December 30, 2017 at 10:59:54 AM UTC-6, Evan Balster wrote: > > Whoopsie! I found errors with the "match" parameter and when the widget > is refreshed. Late night work can be pretty sloppy, eh? > > Following in a close second place, the first hour of the day (day being a relative

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-30 Thread Birthe C
Thank you! Testing your example the dog has stopped meowing and learned to bark. Thank you for all your hard work, Birthe -- 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

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-30 Thread Evan Balster
Whoopsie! I found errors with the "match" parameter and when the widget is refreshed. Late night work can be pretty sloppy, eh? Here's the latest, 0.1.1: https://evanbalster.com/tiddlywiki/condition.json - Fix an error when refreshing the condition widget. - Fix "match" attribute not wo

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-30 Thread coda coder
Hi Evan I'm getting an error here "nextSibling is undefined" using: <$if value={{someTiddler!!someField}} match="yes"> Stuff The former code for reference: <$reveal type=match state="someTiddler!!someField" text="yes" tag="td" class="someClass"> Stuff Coda -- You received this message b

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-30 Thread TonyM
Evan, Mate, as we say in Australia, *I have never being so happy finding someone with the same problems.* Detects if field exists AND has Value The below tests all worked for me, Test 1 <$if value={{!!item-started}}> item-started is set to {{!!item-started}} <$else> No item-started set Te

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-30 Thread BurningTreeC
Thanks Evan, I'll test it later on and will report back Fingers crossed for the architects having a heart for this Am Samstag, 30. Dezember 2017 08:08:49 UTC+1 schrieb Evan Balster: > > Hey, Simon — > > with your additions you're addressing lots of problems I'm facing right >> now. Thanks for

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-29 Thread Evan Balster
Hey, Simon — with your additions you're addressing lots of problems I'm facing right > now. Thanks for your efforts and contributions! I'm solving similar problems. :) Happy to share. I'd very much like to see this in the core, is there a chance? > That comes down to how TiddlyWiki's arch

[tw] Re: Condition: An if-else plugin for wikitext

2017-12-29 Thread BurningTreeC
Hello Evan, This is *great*, with your additions you're addressing lots of problems I'm facing right now Thanks for your efforts and contributions! I'd very much like to see this in the core, is there a chance? kind regards, Simon Am Samstag, 30. Dezember 2017 06:54:54 UTC+1 schrieb Evan Balst