Functions allow you to write complex filter operations in a simple, semantic and understandable way. Do you have any special use cases to share with the community here?
My First Example:
I have some notes tagged with machine-learning
as parent tiddlers.
The parent tiddler has two field extra-notes
, and related-notes
which list all notes (tiddlers) in relation to this parent note
The subtiddlers are note tiddler; their title looks like parent-note/child-note
e.g. prefixed with main note.
Write a simple filter to list all children tiddlers using list-links
.
\function children()
[all[tiddlers]prefix<currentTiddler>]
[get[extra-notes]enlist-input[]]
[get[related-notes]enlist-input[]]
\end children
\function getChildren() [tag[machine-learning]] :map:flat[function[children]]
Then use it like:
<<list-links "[function[getChildren]]">>
What do you think?
Cheat: The old school way is macro and subfilter
Share you function examples.