Hi Chris, I guess, fet is not suitable for that, since it has no notion of grouping, and what you are looking for can't be expressed in "for each tiddler" terms. Still, you can hack your way using a helper that will add grouping by treating it as "setting delimeters" between tiddlers, delimeters like these:
+++!![ GROUP_1 ]
<nothing – for most tiddlers>
=== <linebreak(s)> +++!![ GROUP_2 ]
...
===
Note that this will likely work slowly (O(n^2) where n is the number of tiddlers). The idea would be to have the script part with helpers like these (pseudocode):
const allTiddlersSortedByTitle = ...
const getStartDelimeter = (title) => {
const tiddlerIndex = allTiddlersSortedByTitle.findIndex(tid => tid.title == title)
const isFirst = tiddlerIndex == 0
if(isFirst) return "+++!![ GROUP_1 ]"
// next one starts from a different letter
const isLastInGroup = allTiddlersSortedByTitle[tiddlerIndex + 1][0] != title[0]
const groupLabel = ...
if(isLastInGroup) return "=== \n +++!!["+ groupLabel +"]"
return ""
}
and add "===" to the end epxression.