Using StretchText - multiple stretches, same tiddler, via a <$list>

129 views
Skip to first unread message

Steven Schneider

unread,
Jan 24, 2017, 8:38:02 AM1/24/17
to TiddlyWiki
Hi Folk,

I'm using StretchText (http://stretchtext.tiddlyspot.com/), which is a great macro but am having some trouble with multiple stretches in same tiddler called via a <$list> filter


I must have to do with "state" something I still don't quite get.

Any suggestions?

Thanks!

//steve.

(p.s. Check out DesignWriteStudio -- 20 people learning how to use TiddlyWiki!) 

Jed Carty

unread,
Jan 24, 2017, 10:40:10 AM1/24/17
to TiddlyWiki
It is because the stretch macro uses one of the raw inputs an the state and each of your items has the same raw input even though it is evaluated later to be different. One possible way to get around this is using the variable and macro approach like this:

\define OhNoesItsAMacro()
<$macrocall $name=stretch label="""$(LABEL)$""" rest="""$(REST)$""" content="""$(TEXT)$"""/>
\end


{{$:/core/ui/Buttons/import}}
<h2>Submit Reflection</h2>
<<stretch 'View' 'or <a href={{!!form}} target="_blank">visit</
a>' '{{!!form-embed}}'>> the form to submit your reflection.
<h2>Responses</h2>
Click the buttons to view responses<br><$list filter="[tag{!!assignment}tag{!!assignment-type}]">
<$link>></$link>
<$vars LABEL={{!!headline}} REST={{!!author}} TEXT={{!!text}}>
<<
OhNoesItsAMacro>>
</$vars>
<br>
</$list>

You may be able to do that in a more compact way, but the problem came from the label being {{!!headline}} for each item.

Steven Schneider

unread,
Jan 24, 2017, 1:09:42 PM1/24/17
to TiddlyWiki
Thanks, Jed. I knew it was state. Your approach worked perfectly for my class today!

(For those interested: I have students submit a short reflection on the days reading via a google form. I use Jeremy's xlsx utility to import contents of the form submissions as tiddlers, and can then have students writing in the course wiki for the discussion portion of the class. The wiki is served under updog, so it is fast and painless for me, and for my students!)

Tobias Beer

unread,
Jan 24, 2017, 1:32:33 PM1/24/17
to tiddl...@googlegroups.com
Hi Steven,

Just to mention it in this context, tobibeer/appear can not only do
popups or sliders or accordeon type menus,
but is also capable of rendering these kind of
inline toggles others may call stretch-text.


\define stretch(state,show,hide,content)
<$appear hide="""$hide$""" show="""$show$""" mode="inline" $state="""$state$""">$content$</$appear>
\end

The seats of my new <$appear hide="ridiculously expensive car" show="car" mode="inline" $state="car1">/
/— really it was awfully expensive //</$appear> were of the most comfy leather.

The seats of my new <$appear hide="&zwnj;" show="car" mode="inline" $state="car2">''ridiculously expensive car''// — really it was awfully expensive — //</$appear> were of the most comfy leather.

The seats of my new <<stretch
"car-macro"
"car"
"ridiculously expensive car"
"//— really it was awfully expensive — //"
>> were of the most comfy leather.


Best wishes,

Tobias.

Josiah

unread,
Jan 25, 2017, 1:27:14 PM1/25/17
to tiddl...@googlegroups.com
Tobias

Is this the start of the Stretched Text Olympics? LOL.

Josiah
Reply all
Reply to author
Forward
0 new messages