On Wednesday, May 20, 2015 at 1:16:25 AM UTC-7, Chong wrote:
>
> In TW5 I can't nest the reveal buttons inside each other without having 
> other tiddlers with more reveal buttons. 
> I want be to able to do something like this all in one tiddler:
>
> I went to store. 
> <<moredetail "
>    it was raining so I decided to drive instead of walk
>    <<moredetail "
>       the car took a while to start since it was so cold
>    ">>
>    I arrived at 5pm
>    <<moredetail "
>       It was Sunday so they were just closing up
>    ">>
> ">>
> Then I bought a tomato
> <<more detail "...">>
>

The first problem is that you can't nest macros, so you can't put 
<<moredetail >> *within* the parameters of a call to <<moredetail>>.

However, it *is* possible to implement a "nested reveal" in TW5, though the 
syntax is probably not quiet as simple as you want.

Try this:

\define b(s,t)
<$reveal type="nomatch" text="show" state="$:/state/$s$">
   <$button class="tc-btn-invisible" tooltip="more details">
      <$action-setfield $tiddler="$:/state/$s$" text="show"/>
      $t$
   </$button>
</$reveal>
<$reveal type="match" text="show" state="$:/state/$s$">
   <$button class="tc-btn-invisible" tooltip="less details">
      <$action-deletetiddler $tiddler="$:/state/$s$"/>
      $t$
   </$button>
</$reveal>
\end

<<b 1 "I went to the store...">>
<$reveal type="match" text="show" state="$:/state/1">

   <<b 2 "It was raining so I decided to drive instead of walk...">>
   <$reveal type="match" text="show" state="$:/state/2">

      The car took a while to start since it was so cold.
   </$reveal>
   <<b 3 "I arrived at 5pm...">>
   <$reveal type="match" text="show" state="$:/state/3">

       It was Sunday so they were just closing up.
   </$reveal>
</$reveal>
<<b 4 "Then I bought a tomato...">>
<$reveal type="match" text="show" state="$:/state/4">

   It was delicious.
</$reveal>

The macro <<b>> outputs text that is a "show/hide" toggle.  It uses 
$:/state/xxx to track when the details are shown, and then *removes* 
$:/state/xxx when the details are toggled closed.  This avoids an 
accumulation of random state tracking tiddlers.  Note also that $:/state/* 
tiddlers are 'system' tiddlers, so they don't appear in the sidebar (except 
in the "more>system" tab, of course).  This avoids the ugliness of seeing 
them appear and disappear as you toggle the text.

Let me know how it goes...

enjoy,
-e
Eric Shulman
ELS Design Studios
TiddlyTools - "Small Tools for Big Ideas!"
InsideTiddlyWiki: The Missing Manuals

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
   http://TiddlyTools.github.com/fundraising.html#MakeADonation

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
   http://www.TiddlyTools.com/#Contact

-- 
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 http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8bd98176-14cb-4515-9bcf-01c7dc407685%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to