More elegant way to freeze the current StoryRiver as transclusions in a tiddler?

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

I think you have illustrated a simple way to transclude selected tiddlers in the body of another tiddler but not sure why you limit yourself by saying;

You are after all creating a tiddler for this purpose.

To capture the story you could just set a field to the value in $:/StoryList!!list, but in this case lets say you set the field “transclude-list” in the new tiddler, “end of Story” :nerd_face:

Now create a view template tiddler with the $:/tags/ViewTemplate tag and build into it the condition when field[transclude-list] ie has a value enlist it and loop through the $transclusion of each title. So you can save as many of these lists you wish.

Later you could add to this viewtemplate tiddler

  • The ability to add remove items from the list
  • Drag drop reorder
  • and many other ideas and reflect this on all tiddlers with the transclude-list

Rather than an independent list field you could assign each of the titles as tags on the new tiddler.

Why have static transclusions when you can have a dynamic list on multiple tiddlers.

Regards
Tony

This would follow my own intuition to start providing simple and functional list saving, generation, editing, sharing and use.

You would see this reflected in my flag list work