While there are good documentation on filter, :filter, and :map on tiddlywiki.com, still there are confusions in using them! I would appreciate if through more examples, application of these excellent tools clarified.
Conclusion
Based on @saqimtiaz clarification, I conclude the below discussion as:
There are no requirements for :filter beyond that if it returns a result for an input title, that title is kept and if not, it is discarded.
Similarly, the only requirement for :map is that it return a single result for every input title
Filter run prefixes can accept filter constructors like :filter[all[tiddlers]....
Filter run prefixes :filter, :map and :reduce only receive a single title as input. So if you want to query all tiddlers, you need to start your filter run with all[tiddlers].
:filter is a filter run prefix. Filter run prefixes need the filter run to be provided as literal strings, you cannot use variables. If you want to use a variable, then use the filter[] operator.
In both cases above, a selection constructor is used inside filter and :filter. Are we allowed to use a selection constructor or we have to use selection modifier only?
:filter is a filter run prefix. Filter run prefixes need the filter run to be provided as literal strings, you cannot use variables. If you want to use a variable, then use the filter[] operator.
I have concluded this discussion in the original post (first post in this thread )
I appreciate if Saq (@saqimtiaz) kindly read and correct if there is any incorrect conclusion!
Any contribution is welcome! I also kindly ask Brian (@btheado) if kindly have a look and see if these are can be added to tiddlywiki.com documentation!
I think the only part that maybe needs to be made more explicit in the docs is that :filter, :map and :reduce only receive a single title as input. So if you want to query all tiddlers, you need to start your filter run with all[tiddlers].
To see if I can contribute helpfully to this discussion, and to further my own understanding, I went back to the documentation, I think it fair to call it “Terse” or “sparing in the use of words”. As I come to understand this better I will need to find my own words to describe them, hopefully I can produce something that will help others. The descriptions reads to me as exactly what someone who already understands it would write, not what something someone who does not understand it needs to read.
Starting with referring to filter filter1 and filter2 would be a good start.
The value of currentTiddler outside the run is available in the variable “..currentTiddler”.
Can anyone show how to use <<..currentTiddler>> "outside the run?
[Edit] Also note https://tiddlywiki.com/#Filter%20Run makes no mention that “Filter Runs can have prefixes” and “Filter Run Prefix” tiddlers also make no mention of ## Filter Expression which documents other prefixes = + - ~
To show the application of this discussion, see the Simple Pagination Two example below.
It accept a filter (with any complexity) and produces a list with a header contains alphabetical index buttons! On click the output will be limited to titles prefixed with that letter.