Imma just leave this here:
\define fold(id, caption, content)
<$set name="controller" value={{{
[[$:/temp/state/]addsuffix<currentTiddler>addsuffix[/fold/]addsuffix[$id$]]
}}}>
<$reveal type="nomatch" state=<<controller>> text="open">
<$button class="tc-btn-invisible" set=<<controller>> setTo="open">
''$caption$'' {{$:/core/images/unfold-button}}
</$button>
</$reveal>
<$reveal type="match" state=<<controller>> text="open">
<$button class="tc-btn-invisible" set=<<controller>> setTo="close">
''$caption$'' {{$:/core/images/fold-button}}
</$button>
</$reveal>
<$reveal type="match" state=<<controller>> text="open">
$content$
</$reveal>
</$set>
\end
instead of folding whole transcluded tiddlers this will only fold text.
Folds with the same id inside the same tiddler, will share their state.
To make ids global instead of tiddler wide, change line 2 to:
<$set name="controller" value={{{ [[$:/temp/state/fold/]addsuffix[$id$]]
}}}>
and the corresponding editor button just in case:
<$action-sendmessage
$message="tm-edit-text-operation"
$param="wrap-lines"
prefix='<<fold "id" "caption" """'
suffix='""">>'
/>
and some example:
<<fold "FoldExampleNo1" "Click me to view more :)" """
WOHOOOO Hidden Text!
!! This is great!
""">>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/d5632694-5b5d-44cc-baa5-58ae1f258c29%40googlegroups.com.