Hello again,
I’m experimenting with saving the current StoryRiver as a new tiddler whose text field consists of block transclusions of all currently open tiddlers.
Conceptually, I want to end up with something like this in the new tiddler:
{{Tiddler1}}
{{Tiddler2}}
{{Tiddler3}}
Right now, I’m doing it with an action-createtiddler and a filter that builds the WikiText string:
\define save()
<$action-createtiddler
$basetitle="newStoryRiver"
tags="ready"
text={{{ [list[$:/StoryList]addprefix[{{]addsuffix[}}]join[
]] }}}/>
<$action-sendmessage $message="tm-notify" $param="Done"/>
\end
<$button actions=<<save>>>
{{$:/core/images/star-filled}}
</$button>
This works! The new tiddler’s text field contains the expected sequence of {{Title}} blocks, one per tiddler currently in the StoryRiver.
However, it feels a bit “hacky” to manually glue the WikiText together with addprefix, addsuffix, and join. I’m wondering:
-
Is there a more idiomatic / elegant way in pure WikiText and action widgets to achieve this?
-
For example, some pattern using
$wikify, templates, or another widget that avoids explicitly constructing the transclusion markup as a string? -
Or is building the transclusion WikiText via a filter like this actually the recommended/normal way to do it?
Important: I am not trying to store the StoryRiver as a list field (i.e. $:/StoryList!!list). I specifically want a new tiddler where the text is readable WikiText with {{Title}} transclusions, because I want to edit or rearrange that composite tiddler later as a “document”.
Any ideas, patterns, or examples that do this in a cleaner way would be perfect.
eron