Using Strex

94 views
Skip to first unread message

Steven Schneider

unread,
Mar 9, 2017, 1:15:13 PM3/9/17
to TiddlyWiki
I'm a big fan of Thomas Elmiger work, including his text stretch macro: http://tid.li/tw5/hacks.html#TextStretch

I'm trying to use it here:

<$list filter="[tag[Levels]]">
{{!!title}}: <$macrocall $name=strex content="<$transclude tiddler='{{!!title}}' mode='block'>" label="+" id="id"/>
<br>
</$list>

But the transclude doesn't quite work, it seems.

I've tried this:

Level 1 Exploratory:  <$macrocall $name=strex content="<$transclude tiddler='Level 1 Exploratory' mode='block'>" label="+" id="Level1"/><br>
Level 2 Prototype:  <$macrocall $name=strex content="<$transclude tiddler='Level 2 Prototype' mode='block'>" label="+" id="Level2"/><br>
Level 3 Implementation:  <$macrocall $name=strex content="<$transclude tiddler='Level 3 Implementation' mode='block'>" label="+" id="Level3"/><br>

But can't quite get the stretched texts to open individually.

Any suggestions? (I thought of setting id="{{!!title}}" but that didn't seem to work)

Thoughts or help much appreciated!

//steve.

Thomas Elmiger

unread,
Mar 9, 2017, 2:11:34 PM3/9/17
to TiddlyWiki
Hi Steve

This should do what you want:

<$list filter="[tag[YourTagHere]]">
<$wikify name=tid text={{!!title}}>
<<tid>>: <$macrocall $name=strex content="<$transclude tiddler=<<tid>> mode='block'>" label="+" id=<<tid>>/><br>
</$wikify>
</$list>

The wikify widget is our friend, it turns the parameters that are used in strex into strings that are individual …

Hint: Insert your own tag (Levels?) again.

Glad to help a fan – I would never have come so far with TW without your {{DesignWrite}} course!

All the best,
Thomas

Thomas Elmiger

unread,
Mar 9, 2017, 2:28:25 PM3/9/17
to TiddlyWiki
By the way: To reveal whole tiddlers I made the listreveal plugin – it comes with (minimal) documentation now: https://tid.li/tw5/plugins.html#%24%3A%2FControlPanel:%24%3A%2Fplugins%2Ftelmiger%2Flistreveal%2Freadme%20%24%3A%2FControlPanel

I did not know it was possible to use strex the way you do :–)

Cheers,
Thomas

Steven Schneider

unread,
Mar 9, 2017, 3:59:25 PM3/9/17
to TiddlyWiki
Thanks, Thomas! This is great, it worked perfectly I've never used the Wikify widget before; I always use set. I wonder what the difference is? I rarely see the wikify widget used...

Always the Professor: from TiddlyWiki.com:

* The wikify widget parses and renders a string of text and assigns the result to a specified variable. The new value of the variable is available to the content within the wikify widget.

* The set variable widget assigns a value to a specified variable. The new value of the variable is available to the content within the set variable widget.

So wikify parses and renders, while set assigns. Hmmm...

Anyway, thanks!

Thomas Elmiger

unread,
Mar 9, 2017, 4:19:25 PM3/9/17
to TiddlyWiki
My personal mental model of the two functions is this:

Say you have a (current) tiddler titled "My first tiddler".

<$wikify name=tid text={{!!title}}>

puts a (rendered) string into the variable, <<tid>> is equal to the text "My first tiddler".

<$set name=tid value={{!!title}}>

puts "{{!!title}}" into the variable <<tid>> which in *some* contexts would be replaced with "My first tiddler" – but in the context of another current tiddler it would be replaced with the other tiddler’s title.

As a macro parameter the wikified <<tid>> inputs "My first tiddler" into the macro, but the set <<tid>> inputs "{{!!title}}" – the first can be used as an id, the second can’t.

Maybe this is not 100% scientific, but it helps me a lot!

All the best!
Thomas
Reply all
Reply to author
Forward
0 new messages