@Jed, thanks for input on it. 

----------

For anyone curious, I needed it to make a little quick *reveal* type macro 
because IMO the RevealWidget syntax is just too messy. 
The syntax for qreveal (=quick reveal) is:

<<qreveal label content>> 


the "label" is optional, but if you are using more than one qreveal in a 
tiddler then you need labels for them

So in practice it might look like

<<qreveal "
So this is some content that will be revealed.
">>


Here's the macro:


title: macro/qreveal
tags: $:/tags/Macro
text:

\define qreveal(label, content)
<$set name=label filter="""$content$ +[first[]]""" emptyValue="nolabel" 
value="$label$">
<$set name=content filter="""$content$""" emptyValue="""$label$""" value=
"""$content$""">

<$reveal type="nomatch" text="show"
    state={{{ 
[[$(currentTiddler)$]addprefix[$:/state/qreveal/]addsuffix[/]addsuffix<label>] 
}}}>

<$button setTo="show"
    set={{{ 
[[$(currentTiddler)$]addprefix[$:/state/qreveal/]addsuffix[/]addsuffix<label>] 
}}}>
   <<label>> ▷
</$button>

</$reveal>
<$reveal type="match" text="show"
    state={{{ 
[[$(currentTiddler)$]addprefix[$:/state/qreveal/]addsuffix[/]addsuffix<label>] 
}}}>

<$button setTo="hide"
    set={{{ 
[[$(currentTiddler)$]addprefix[$:/state/qreveal/]addsuffix[/]addsuffix<label>] 
}}}>
   <<label>> ▽
</$button>

<<content>>

</$reveal>
</$set>
</$set>
\end



P.S The reason for the complex way to set state names is given here 
<https://github.com/Jermolene/TiddlyWiki5/issues/3376>, in Jeremys post.


<:-)

-- 
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/e500df80-b215-47ea-9f04-2f41092232f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to