Hit a small snag on a project which I could probably resolve just by iterating – but thought I’d turn it over here and see if the solution was obvious to anyone:
\define export-row(start_depth:"", separator:"")
\whitespace trim
<$vars linebreak="<br>
">
<$set name="depth" filter="[<currentTiddler>get-stream-root:includeall[]count[]subtract<start_depth>]">
<$set name="asterisks" filter="[<depth>subtract[1]][range[1]join[*]]">
<$set name="regular" filter="[<currentTiddler>get[text]addprefix<asterisks>addprefix[ ]addsuffix<linebreak>]" select="0">
<$text text=<<regular>> />
<$list filter="[<currentTiddler>has[stream-list]]" variable="_NULL">
<$list filter="[enlist{!!stream-list}is[tiddler]]">
<$macrocall $name="export-row" start_depth="$start_depth$" separator="$separator$"/>
</$list>
</$list>
</$set>
</$set>
</$set>
</$vars>
\end
It currently calculates the depth correctly and outputs that as a prefix – however, I would like the depth-1 number of asterisks as the prefix instead.