This is a stripped-down version of a single section of Grok TiddlyWiki, optimized for fast loading and readability by search engines. Some features are missing.
For the full Grok TiddlyWiki experience, please visit the wiki version of this page.
So that's what filters are…now what do they look like, and how do we use them?
Filters, or, more formally, filter expressions, consist of one or more filter runs, which each contain one or more filter steps. For now, we'll only worry about filter expressions containing a single run – you'll be able to accomplish most basic tasks without needing multiple runs. However, know that individual runs can be combined in various ways to form a more complex filter expression, and we'll discuss this further in chapter 5.
If you've ever used any shell language (Bash, MS-DOS, PowerShell, etc.) – or even if you haven't – you can think of a filter run as a pipeline. You put a list of tiddlers into the left end of the pipeline; unless you say otherwise, all tiddlers in the wiki go in the left end. The tiddlers then pass from left to right through a series of steps in the pipeline. Each step can remove tiddlers from the list that don't match some criteria, generate and output a new list of tiddlers based on the existing list, or ignore the existing list and spit out an entirely new list. The next step then gets to make its own changes to the list output by this step, and so on until we come to the right side of the pipeline and the output of the last step is the result of the filter run.
Here are some very simple filter expressions. Each of them has just one run containing one step:
[title[JaneDoe]]
– this returns the tiddler JaneDoe
title
, resulting in just [[JaneDoe]]
.[tag[Contact]]
– this returns all tiddlers tagged Contact
[links[]]
– this returns all the tiddlers that have been linked to by any tiddler in your wikiLet's try using some of these filters. To do so, open Advanced Search . You can find this option in the Tools tab in the sidebar or next to the search box, or you can press Ctrl+Shift+A. Then pick the Filter tab and type in one of the expressions above. You'll see a list of the tiddlers that match.
If you try the last filter listed above, [links[]]
, you might notice a whole bunch of funny-looking tiddlers show up, with names starting with $:/
. What's up with those? Those are system tiddlers; they contain configuration settings or bits and pieces of TiddlyWiki itself. If you don't want to see the system tiddlers, add !is[system]
to the beginning of the filter run to eliminate them (read !
as not). So that will look like [!is[system]links[]]
.
Let's look at that one again: [!is[system]links[]]
. This run has two steps: first we eliminate all tiddlers that are system tiddlers (alternatively, you could choose to think of it as “keep all tiddlers that are not system tiddlers”), then we look at each of the tiddlers in that reduced list and spit out all of the tiddlers it links to.
Filter expressions are quite sensitive to minor mistakes in punctuation. Once you've become familiar with the most common mistakes, spotting and fixing them will be trivial, but at first they may be extremely frustrating. These three errors are particularly common:
tag[Contact]
, for instance, is not a valid filter expression, as it consists of a single filter step, not a complete filter run. If you see the text Filter error: Missing [ in filter expression instead of the list of tiddlers you expected, this is likely your problem.[tag[Contact]
). A useful habit to develop is inserting both the left and the right square bracket whenever you come to a left square bracket, then pressing the left arrow key to put the cursor back between them – this way, you won't have to remember how many brackets need to be closed.[!is[system] links[]]
. What this actually does is filter on the values of the field called links
(a space followed by the word links). Unless that is actually what you want, leave out the space.Write and test filter expressions for the following criteria:
Application
.Application
and OnboardingProcess
.OnboardingProcess
tag to at least one application if you haven't done so already, if you want to see any results.JaneDoe
, but only if it is tagged with Application
.EmployeeProfileSetupMeeting
.links[]
, there is a backlinks[]
operator.EmployeeProfileSetupMeeting
and are not daily-journal tiddlers.