mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-07-03 18:53:28 +00:00
0ab9ec1ad3
* Refactored the is operator for simplicity and efficiency. * Improve `is` filter documentation. * Update is.js * extracted `subops.length` to `num_of_subops` * renamed `subop` to `operator` for clarity/differentiation from `subops` * refactored to avoid using a `Set` object. * Update is.js
39 lines
2.0 KiB
Plaintext
39 lines
2.0 KiB
Plaintext
created: 20140410103123179
|
|
modified: 20161127142329969
|
|
tags: [[Filter Operators]] [[Common Operators]] [[Negatable Operators]]
|
|
title: is Operator
|
|
type: text/vnd.tiddlywiki
|
|
caption: is
|
|
op-purpose: filter the input by fundamental category
|
|
op-input: a [[selection of titles|Title Selection]]
|
|
op-parameter: a category
|
|
op-parameter-name: C
|
|
op-output: those input tiddlers that belong to category <<.place C>>
|
|
op-neg-output: those input tiddlers that do <<.em not>> belong to category <<.place C>>
|
|
|
|
The parameter <<.place C>> specifies zero or more fundamental categories using the following syntax:
|
|
|
|
<$railroad text="""
|
|
[{: ("current" | "missing" |: "orphan" | "shadow" | "system" | "tag" | "tiddler" | "image") +"+" }]
|
|
"""/>
|
|
|
|
|!Category |!Matches any tiddler that... |
|
|
|^`current` |is the [[current tiddler|Current Tiddler]] |
|
|
|^`image` |has an image ContentType |
|
|
|^`missing` |does not exist (other than possibly as a shadow tiddler), regardless of whether there are any links to it |
|
|
|^`orphan` |has no [[hard links|Hard and Soft Links]] to it |
|
|
|^`shadow` |is a [[shadow tiddler|ShadowTiddlers]], regardless of whether it has been overridden with a non-shadow tiddler |
|
|
|^`system` |is a [[system tiddler|SystemTiddlers]], i.e. its title starts with `$:/` |
|
|
|^`tag` |is in use as a tag |
|
|
|^`tiddler` |exists as a non-shadow tiddler |
|
|
|
|
If <<.place C>> is anything else an error message is returned. <<.from-version "5.1.14">> if <<.place C>> is blank, the output is passed through unchanged (in earlier versions an error message was returned).
|
|
|
|
`!is[tiddler]` is a synonym for `is[missing]`, and vice versa.
|
|
|
|
When <<.op is[missing]>> is the first operator in a [[run|Filter Run]], its output is always empty. And when <<.op is[shadow]>> comes first, it outputs only those shadow tiddlers that have been overridden. This is because the [[initial input to a run|Filter Expression]] contains only <<.em non>>-shadow tiddlers.
|
|
|
|
The <<.olink all>> operator is similar, but its scope is the whole wiki.
|
|
|
|
<<.operator-examples "is">>
|