Ciao Thomas, c pa, Mat & others... Great stuff. Very useful.
I personally see immediate good use cases for it: For instance, inline clarifications of Middle English words in an ebook version of Chaucer's "A Canterbury Tales". I can also see other interesting apps for "verbal games". SUGGESTION: I'm not sure if it would be feasible but one could really go places with this is IF expansions/contractions could be NESTED. Best wishes Josiah On Monday, 8 August 2016 23:31:05 UTC+2, Thomas Elmiger wrote: > > Thank you, c pa, for reviewing my solution and suggesting an alternative! > Your version resembles my first try (TextStretch 0.7.1 > <http://tid.li/tw5/hacks.html#TextStretch%200.7.1>) in many ways. Let me > point out some differences: > > 1) Using the $id$ supplied by the user makes this parameter mandatory for > many cases. As soon as you have two or more stretch elements you *must* > define a unique id, else all elements will open and close at the same time. > I wanted to generate an id, if it is not specified by the user: > > <$set name="uid" filter="[<id>!prefix[_false_]]" value=<<id>> emptyValue=< > <content>> > > > If no id was set by the user, my default "_false_" is used => I assign the > content value as the new id. This already works, but the state tiddler > titles can get very long when the whole text-content ist appended. This is > not only ugly, it also blows up the size of your wiki. This is why I > generate a hash number over the text: > > <$set name="xuid" filter="[<uid>prefix[_false_]]" value="error: xuid > hashing" emptyValue=<<HashStr """$uid$""">> > > > By the way, the instruction to import the HashStr-macro is already in my > docs: > "Drag the links from the following list to your Wiki, save and *reload*." > The link to the > > - macro for hashing: $:/_telmiger/utils/HashStr.js > <http://tid.li/tw5/hacks.html#%24%3A%2F_telmiger%2Futils%2FHashStr.js> > > is in the list. Should I emphasize the reload part? > > (Maybe there is a better solution to call the core function > $tw.utils.hashString(str); ? – to call it from my own js-macro was the > only one I found.) > > > 2) The reason, why I use <$set name="var" value="""$var$"""> a lot is > this: I had some problems with $content$ containing/surrounded by "" or ' > and try to sanitize it by putting it between """three quotation marks""" on > each side. I copied this from Mat’s solution, actually. When I have the > time, I will do further testing, if they all are needed. > > Thanks again for your feedback – this is highly appreciated – and good > night! > Thomas > > -- 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. 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/165eff6d-b518-4c15-9a78-0818303cfe04%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.