Tree Macro and Filter List of Tiddlers

Is there a way to display as tree a mixed list of tiddlers?

Example

Book
Book/Chp01/page01
Book/Chp02/page02
Note/L01
Note/L02/P01
Note/L02/P02
Book/Appendix/A01
Book/References
Note/References
Note/Index/A
Note/Index/B
Leaflet/Sec01
Leaflet/Sec02
Leaflet/Sec02/P01
Leaflet/Sec02/P02
...

You can have a wide variety of tiddlers. No order! Sometimes you don’t now how many prefixes you have.

The list of tiddlers is stored in list field of a content tiddler (host tiddler).

Perhaps something like this:

<style> .myTree ol { margin-bottom:0; } </style>
<div class="myTree">
   <$list filter="[enlist{!!list}splitbefore[/]]" variable="pre">
      <$macrocall $name="tree" prefix=<<pre>>/>
   </$list>
</div>

The “myTree” class is used to suppress the whitespace that normally occurs at the end of the <ol>...</ol> that surrounds the <<tree>> macro output.

-e