What's the use of subfilter in real life? It seems such a strange beast. I'm really confused. I wish there be an equivalent of map() found in functional language. I thought subfilter was just that but visibly it is not.
<$set name="F" filter="[{!!setting}match[somevalue]]" value="[somefilter]" emptyValue="[someotherfilter]">
<$list filter="[subfilter<F>]"/>
</$set>
in the complete filter below, what is the input and what is the parameter S?[subfilter[one two three]addsuffix[!]]input should be: every tiddlers (but system tiddlers).S is <<one two three>> and so S is a collection of three tiddler titles.
Although it does not seems so because
[[one two three]addsuffix[!]]
does not produce the same result ("one two three!" instead of "one! two! three!").
[enlist[one two three]addsuffix[!]]Le lundi 26 octobre 2020 à 19:00:52 UTC+1, Mark S. a écrit :Unfortunately, using a subfilter won't allow you to process the tiddlers the way you want. You will need a nested loop, with the outer list finding the tiddlers and the inner list extracting the first word.
<$list filter="[tag[Chrome]]">
<$list filter="[<currentTiddler>splitregexp[\W]!is[blank]first[]]"/>
</$list>
<$list filter="[tag[TableOfContents]]">
{{{ [all[current]split[]first[]] }}}, {{{ [all[current]split[ ]first[]] }}}, <$link/><br>
</$list><style>
p.uppercase {
text-transform: uppercase;
}
p.lowercase {
text-transform: lowercase;
}
p.capitalize {
text-transform: capitalize;
}
</style>
<$list filter="[tag[TableOfContents]]">
<p class="uppercase"><<currentTiddler>></p>
<p class="lowercase"><<currentTiddler>></p>
<p class="capitalize"><<currentTiddler>></p>
<hr>
</$list>[subfilter[one two three]addsuffix[!]]
\define my-splitting-headache()<$set name="chrome" value="[tag[HelloThere]]"><$list filter="[subfilter<chrome>]" ><$list filter="[<currentTiddler>splitregexp[\W]!is[blank]first[]]"/></$list></$set>\end
<$wikify text=<<my-splitting-headache>> name=headache><$list filter="[<headache>sort[]]" /></$wikify>
\define system-tags() text title modified modifier created creator tags list list-after list-before caption type
<$list filter="[fields[]!subfilter<system-tags>]">
</$list><$list filter="[subfilter<system-tags>]">
</$list>\define chapters() [tag[TableOfContents]]
<$list filter="[subfilter<chapters>]">
</$list><$list filter=<<chapters>> >
</$list>
I'm not really understanding what your code below aim to achieve (although I tried it):\define system-tags() text title modified modifier created creator tags list list-after list-before caption type<$list filter="[fields[]!subfilter<system-tags>]"></$list>I got unexisting tiddlers, or macros tiddlers but with incomplete names and all seems rather random.
As such, I've been unable to understand your further points. Except that the new filter operator seems interesting, although not as easy to use as one would like to. For instance, this does not seems to work:\define finish-by-iki() [get[title]suffix[iki]]<<.operator-example 42 "[tag[HelloThere]+filter<finish-by-iki>]">>
\define finish-by-iki() [get[title]suffix[iki]]
<<.operator-example 42 "[tag[HelloThere]subfilter<finish-by-iki>]">>A Gentle Guide to TiddlyWikiDiscover TiddlyWikiSome of the things you can do with TiddlyWikiTen reasons to switch to TiddlyWiki
Please do say what you want to do with the first word / letter ?
<$list filter="A B C D E F G I L M O P R S T U V Z" variable=firstchar >
Then
<$list filter=[tag[glossaire]prefix<firstchar>sort[]]">
</$list>
</$list>Other than a question of taste, or of giving a meaningful name to a complex filter preceding the get operator in my example, it seems that subfilter has no other intterest, isn't it?
... if you wanted to have different filters based on a field value, you could write:Note in the above example, I've used the "conditional variable assignment" form of $set (see https://tiddlywiki.com/#SetWidget)<$set name="F" filter="[{!!setting}match[somevalue]]" value="[somefilter]" emptyValue="[someotherfilter]">
<$list filter="[subfilter<F>]"/>
</$set>