Hi Mat

Good stuff. I support the idea of making hide/show buttons easier to use.

However, there are some issues with this proposal as it stands:

* It’s not backwards compatible. Right now there are lots of `<$button>` 
widgets without any attributes that use action widgets to do their stuff
* The proposed algorithm for autogenerating the state tiddler title isn’t 
robust enough to permit, say, two hide/show constructions within a single 
tiddler

An alternative approach might be to devise a macro <<accordian>> that takes the 
text of the button and the title of a tiddler containing the content. Then one 
could use the target tiddler title as part of the state tiddler title, making 
it possible to have multiple accordions within a single tiddler as long as they 
each target a different tiddler.

Best wishes

Jeremy

> On 23 Jun 2019, at 12:12, Mat <[email protected]> wrote:
> 
> Before I post this on gh, I'd like to hear what you think of the following 
> idea:
> 
> "I want a button that does...."
> 
> ...is a common need but requires a more involved process than should be 
> needed. For one thing, it often also requires the RevealWidget which is a bit 
> complex. In particular, if you want the "normal" look for a button, namely 
> one button that does both "on" and "off" (the "Accordion" example 
> <https://tiddlywiki.com/prerelease/#RevealWidget>) then you need to create 
> two buttons and two RevealWidgets. Way too complex.
> 
> So to serve this common use case, could both of ButtonWidget + RevealWidget 
> use a default state tiddler like so "$:/state/<current>"? Default values are 
> perhaps true and false. And if this default state is used, the RevealWidget 
> further defaults to type=match and text=true
> 
> This would allow for really simple syntax:
> 
> <$button>Toggle</$button>
> 
> <$reveal>
> 
> Content
> 
> </$reveal>
> 
> 
> So, this idea is really two individual proposals because of the typical 
> coexistence between the widgets:
> 
> 1) Make the ButtonWidgets set and setTo have default values 
> $:/state/<current> and true. For this to be meaningful, the widget must first 
> check to see if this state tid is already set, in which case it sets it to 
> false or, perhaps better, deletes the state tid.
> The resulting state tiddler can of course be used for anything...
> 
> 2) ...but, particularly for the RevealWidget; if no RevealWidget state 
> parameter is defined then default to state=$:/state/<current>  and type=match 
> and text=true
> 
> 
> <:-)
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TiddlyWikiDev" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/tiddlywikidev 
> <https://groups.google.com/group/tiddlywikidev>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywikidev/350ca438-2a71-46fb-80f9-08d271a125c2%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tiddlywikidev/350ca438-2a71-46fb-80f9-08d271a125c2%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" 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/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/0103C8A7-1273-4FA4-A4E4-E7B0BA353766%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to