Apply macro for each item in a list

Hello,

I’m using TiddlyTool TOC to build a TOC for my TW. It works wonderful with tags; however I’d like to tag a few “start here” tiddler, and then make TOC for each tiddler tagged “start here” using “field:parent”.

I tried to pass a list into the macro, but it doesn’t work:

<$set name = "start" filter="[tag[start here]]">
<div class="tc-table-of-contents">
<$macrocall $name="toc-tree" here="start" field="field:parent"/>
</div>

I’m not quite sure what’s the next step to try. I appreciate any suggestion.

Thank you for reading my question. May you have a great day.

Currently, TiddlyTools <<toc-tree>> macro does not support using a list for the “here” parameter (i.e, a “forest” rather than a single tree) in a single invocation of the macro. I will look into extending the funtionality to do so, but it may be a bit complicated, since everything is done through recursion, which can be quite tricky to get just right.

In the mean time, you might try something like this to produce separate trees, one for each tiddler tagged with start here:

<$list filter="[tag[start here]]" variable=root_tag>
<div class="tc-table-of-contents">
<$macrocall $name="toc-tree" here=<<root_tag>> field="parent"/>
</div>
</$list>

Let me know if this is sufficient for your needs.

-e

Thank you for your reply! This code works as expected.