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.
We saw a few examples of filter steps in the previous section. Let's take a closer look at the syntax.
Filter steps are composed of three parts, which take this basic form:
operator:suffix[parameter]
tag
operator, the parameter indicates which tag you want to match.The exact meaning of the suffix and parameter depends on which operator is being used.
As briefly mentioned in the previous section, you can place a !
(pronounced not or bang) before the operator. Typically, this negates its meaning, so that whatever tiddlers it would have allowed to pass it now filters out, and vice versa. With a few operators, it does something different and operator-specific.
Putting this together, a simple filter step we saw in the previous section was tag[Contact]
. In this step, tag
is the operator and Contact
is the parameter. Most commonly, the parameter goes in square brackets, but we'll learn in chapter 4 that it can also be placed in <angle brackets>
or {curly braces}
for different effects.
The tag
operator has an optional suffix strict
(don't worry about what it does for now). If we used it, our filter step would look like tag:strict[Contact]
.
We can also talk about the inputs or input tiddlers and outputs or output tiddlers of a filter step. Unlike operators, suffixes, or parameters, these do not correspond to text in the filter expression; rather, they are the data that moves through the pipeline from left to right when TiddlyWiki evaluates the filter.
Input tiddlers are the tiddlers that come down the pipeline from the left side of the operator.
[tag[Person]]
, all tiddlers in the wiki are input tiddlers to tag[Person]
. Unless you use one of a special set of filter operators called constructors as the first step in a run, all tiddlers in the wiki are the inputs to the leftmost step. Constructors ignore any input they receive and generate an entirely new set of output tiddlers based only on their suffix and parameters (i.e., they construct a list), so if TiddlyWiki sees one as the first step of a run, it saves itself some effort by not passing the constructor any input at all.[title[JaneDoe]tag[Person]]
, the sole input tiddler to tag[Person]
is JaneDoe
. (title
is a constructor.)[tag[Application]tag[Person]]
, the input tiddlers to tag[Person]
are all the tiddlers in the wiki tagged with Application
.Output tiddlers, similarly, are the tiddlers that get passed off to the next step in the run (or become the result of the entire filter run, if this is the last step). In the [tag[Application]tag[Person]]
example above, the outputs of tag[Application]
are all the tiddlers in the wiki tagged with Application
. Or to put it another way, the outputs of tag[Application]
are the inputs to tag[Person]
.
These are uncommon, but for the sake of completeness:
search:myfield:literal[parameter]
.pad[5],[-]
.What do you think happens if you run the filter [tag[Person]title[EmployeeInformationSystem]tag[Application]]
? Assume that the EmployeeInformationSystem
tiddler is tagged Application
but not Person
.
Check your answer by running the filter in TiddlyWiki, after ensuring that EmployeeInformationSystem
is tagged appropriately.
What do you think happens if you use the title
constructor to add a tiddler that does not exist to the pipeline?
Check your answer by running a filter in TiddlyWiki.
go to answerWhat happens if you add a suffix that doesn't have any meaning to a filter operator, such as tag
or title
?