How to Pass Rendered Tiddler to Macro?

I have a somewhat complicated filter that pulls in data from multiple tiddler sources and produces the input for a macro I’m using addsuffix… and that works.

I’d like to extend that to a list.

I may just be brain-dead. How do I concatenate all of the runs of a list into a variable?

@jamesmclellan perhaps you could expand on this a little more, to me the Topic title describes something different to that in the body of your post.

Questions;

  • Is it just storing a list of titles from multiple sources?
  • Do your want the rendered list, ie the HTML output?
  • Perhaps the list you create should have the prefix applied at the last moment to save storing more bytes

My typical approach would be;

  • to collect all the filters into a function “myfunc”
  • add +[format:titlelist[]join[ ]] at the end
  • then use [<myfunc>enlist-input[]addprefix<yourprefix>]

Old:
I’m collecting a bunch of inputs to a statistics function : # of tests, # of outcomes, threshold, quality; subordinate function inputs - tests, possible paths, threshold, quality from fields in two groups of tiddlers identified bu different tags.

In the working version, I addsuffix[] them all together and pass them to a macro as a formatted string.

New:
In the not-working version, I’d like to perform statistics on the entire group, instead of individual analyses.

I have a new tiddler called “group” which two lists, the subordinate nested inside the primary. The addsuffix[] filter is inside the inner list. I’ve added a comma to join the records. This produces a string that looks right for the statistics macro.

To pass the string into the macro, I’ve created a new “test” tiddler and have $set a variable “item” with the value of “[[group]text]”.

The value looks right when I try to examine it with <<item>> in the “test” tiddler; but if I try to pass it to the macro with $macrocall arg={{{[<item>]}}} the macro complains that it’s just been fed a bunch of markup, not the string it’s expecting.

[edited] To place backticks around some code examples TW_Tones

I am still trying to understand, I don’t want you to go overboard, but there remains too little information for me to “get it”.

  • Hmm, Not sure what this is. It does not appear to be valid syntax.

Perhaps you mean [[group]get[text]] or [{group}], but what does the group tiddlers text field look like?

  • Do you use the $set filter= method?
  • Is the macro TiddlyWiki Script or otherwise?
  • Is this a single item or a list?
  • Why now just arg=<<item>>

Sorry. I was typing from memory on a different machine. Using <$set name=“item” tiddler=“group” field=“text”>

Hi James,

This is actually the purpose of the $wikify widget (hence its name): it lets you put the result of what is produced by your wikitext (typically inside a procedure) into a variable, for later reuse. See definition and examples here: https://tiddlywiki.com/#WikifyWidget

– Xavier

Since you were struggling with concatenating via addsuffix, perhaps you just mean this kind of trick:

<$let string={{{ [<currentTiddler>] has this that [[the other]] on TiddlyWiki [<version>addprefix[v]] =on [{!!created}format:date[MMM 0DD]] +[join[ ]] }}}>

<<string>>

</$let>

(Note if there’s any risk of duplicate values, putting = immediately before later values makes sure that those later duplicate values are not removed.)

The $wikify widget worked! Thank you!

Good to know! Thank you.