mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-22 22:10:03 +00:00
Extended the filter documentation
This commit is contained in:
parent
8ef520ef37
commit
a3384d101e
@ -1,9 +1,3 @@
|
|||||||
created: 20130827080000000
|
|
||||||
modified: 20140107114229585
|
|
||||||
tags: concepts
|
|
||||||
title: TiddlerFilters
|
|
||||||
type: text/vnd.tiddlywiki
|
|
||||||
|
|
||||||
Filters are used in TiddlyWiki to choose tiddlers by specifying simple match criteria.
|
Filters are used in TiddlyWiki to choose tiddlers by specifying simple match criteria.
|
||||||
|
|
||||||
! Examples
|
! Examples
|
||||||
@ -44,7 +38,7 @@ A filter string consists of one or more runs of filter operators that each look
|
|||||||
* ''prefix'': tests whether a tiddlers title starts with the prefix specified in the operand
|
* ''prefix'': tests whether a tiddlers title starts with the prefix specified in the operand
|
||||||
* ''limit'': limits the number of subresults to the integer specified in the operand
|
* ''limit'': limits the number of subresults to the integer specified in the operand
|
||||||
* ''tag'': tests whether a given tag is (`[tag[mytag]]`) or is not (`[!tag[mytag]]`) present on the tiddler
|
* ''tag'': tests whether a given tag is (`[tag[mytag]]`) or is not (`[!tag[mytag]]`) present on the tiddler
|
||||||
* ''{field}'': tests whether a tiddler field has a specified value (`[modifier[Jeremy]]`) or not (`[!modifier[Jeremy]]`)
|
* ''{field}:'': tests whether a tiddler field has a specified value (`[modifier:[Jeremy]]`) or not (`[!modifier:[Jeremy]]`)
|
||||||
* ''tags'': selects the tags on the currently selected tiddlers
|
* ''tags'': selects the tags on the currently selected tiddlers
|
||||||
* ''tagging'': selects the tiddlers tagged with the currently selected tiddlers
|
* ''tagging'': selects the tiddlers tagged with the currently selected tiddlers
|
||||||
* ''untagged'': selects the any of the selected tiddlers that do not have at least one tag
|
* ''untagged'': selects the any of the selected tiddlers that do not have at least one tag
|
||||||
@ -69,7 +63,7 @@ The operands available with the `is` operator are:
|
|||||||
* ''tiddler'': selects all tiddlers excluding shadows, whether or not they are SystemTiddlers
|
* ''tiddler'': selects all tiddlers excluding shadows, whether or not they are SystemTiddlers
|
||||||
* ''system'': selects all SystemTiddlers
|
* ''system'': selects all SystemTiddlers
|
||||||
* ''shadow'': selects all ShadowTiddlers
|
* ''shadow'': selects all ShadowTiddlers
|
||||||
* ''current'': selects the CurrentTiddler
|
* ''current'': selects the current ContextTiddler
|
||||||
* ''missing'': selects all MissingTiddlers
|
* ''missing'': selects all MissingTiddlers
|
||||||
* ''orphan'': selects all OrphanTiddlers
|
* ''orphan'': selects all OrphanTiddlers
|
||||||
|
|
||||||
@ -79,6 +73,16 @@ If a filter operator is written with curly brackets around the operand then it i
|
|||||||
|
|
||||||
''[search{$:/temp/search}]'': selects all tiddlers containing the string contained in the tiddler titled ''$:/temp/search''.
|
''[search{$:/temp/search}]'': selects all tiddlers containing the string contained in the tiddler titled ''$:/temp/search''.
|
||||||
|
|
||||||
|
! Regular Expression Filters
|
||||||
|
|
||||||
|
The field-filter also accepts regular expressions in the form `/regexp/modifier`. Please refer to you favourite JavaScript documentation to learn more about regular expressions and modifiers.
|
||||||
|
|
||||||
|
In the easiest form, regular expressions allow you do do a search on substrings for every field:
|
||||||
|
|
||||||
|
* `title:[/example/]`: searches for all tiddlers having "example" in its title.
|
||||||
|
* `title:[/example$/]`: `$`is an "anchor" for the end of the text. So "example" has to be the end of the title.
|
||||||
|
* `text:[/jeremy|ruston/i]`: Searches for tiddlers containing Jeremy's first or last name, ignoring the case.
|
||||||
|
|
||||||
! Runs
|
! Runs
|
||||||
|
|
||||||
Operators are combined into runs that function as logically ANDed expressions by bashing them together and merging the square brackets:
|
Operators are combined into runs that function as logically ANDed expressions by bashing them together and merging the square brackets:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user