-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
58 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
created: 20240710161501472 | ||
list-after: $:/core/ui/ViewTemplate/body | ||
modified: 20240713020832439 | ||
tags: $:/tags/ViewTemplate | ||
title: $:/editions/tw5.com/empty-tag-node-template | ||
type: | ||
|
||
<$list filter='[<storyTiddler>!has[text]] :filter[tagging[]]'> | ||
The following tiddlers are tagged with <<tag>>: | ||
</$list> | ||
<<list-links filter:"[<storyTiddler>!has[text]tagging[]]" class:"multi-columns">> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 27 additions & 7 deletions
34
editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,59 @@ | ||
created: 20210428083929749 | ||
from-version: 5.2.0 | ||
modified: 20240312203002082 | ||
modified: 20240717120111427 | ||
rp-input: the filter output of all previous runs so far | ||
rp-output: output titles replace the output of previous filter runs | ||
rp-purpose: sort the input titles by the result of evaluating this filter run for each item | ||
rp-suffix: the <<.op :sort>> filter run prefix uses a rich suffix, see below for details | ||
rp-suffix: the :sort filter run prefix uses a rich suffix, see below for details | ||
rp-suffix-name: S | ||
tags: [[Named Filter Run Prefix]] | ||
title: Sort Filter Run Prefix | ||
type: text/vnd.tiddlywiki | ||
|
||
<$railroad text=""" | ||
\start none | ||
\end none | ||
( ( ":sort" ) | ||
( : ":string" | ":alphanumeric" | ":number" | ":integer" | ":version" | ":date" ) | ||
( : ":casesensitive" /"required for string and alphanumeric"/ | ":caseinsensitive" /"required for string and alphanumeric"/ | ":reverse" /"optional"/ | - ) | - ) | ||
( ":sort" ) | ||
( ":" ) | ||
( : "string" | "alphanumeric" | "number" | "integer" | "version" | "date" ) | ||
( ":" ) | ||
{ | ||
( | ||
( | ||
( : "caseinsensitive" /"required for string and alphanumeric"/ | "casesensitive" /"required for string and alphanumeric"/) | ||
| "reverse" /"optional"/ | ||
) | ||
) | ||
+"," | ||
} | ||
[[run|"Filter Run"]] | ||
"""/> | ||
|
||
Each input title from previous runs is passed to this run in turn. The filter run transforms the input titles into the form needed for sorting. For example, the filter run `[length[]]` transforms each input title in to the number representing its length, and thus sorts the input titles according to their length. | ||
|
||
Note that within the filter run, the <<.var currentTiddler>> variable is set to the title of the tiddler being processed. This permits filter runs like `:sort:number[{!!value}divide{!!cost}]` to be used for computation. The value of <<.var currentTiddler>> outside the run is available in the variable <<.var "..currentTiddler">>. | ||
|
||
The `:sort` filter run prefix uses an extended syntax that allows for multiple suffixes, some of which are required: | ||
The `:sort` <<.place S>> filter run prefix uses an extended syntax that allows for multiple suffixes, some of which are required: | ||
|
||
``` | ||
:sort:<type>:<flaglist>[...filter run...] | ||
|
||
``` | ||
|
||
* ''type'': Required. Determines how the items are compared and can be any of: ''string'', ''alphanumeric'', ''number'', ''integer'', ''version'' or ''date''. | ||
|
||
* ''flaglist'': comma separated list of the following flags: | ||
|
||
** ''casesensitive'' or ''caseinsensitive'' (required for types `string` and `alphanumeric`). | ||
*** defaults to: //caseinsensitive// if the flag is missing. | ||
*** for clarity this parameter should be always defined. | ||
|
||
** ''reverse'' to invert the order of the filter run (optional). | ||
|
||
Note that filter runs used with the `:sort` prefix should return the same number of items that they are passed. Any missing entries will be treated as zero or the empty string. In particular, when retrieving the value of a field with the [[get Operator]] it is helpful to guard against a missing field value using the [[else Operator]]. For example `[get[myfield]else[default-value]...`. | ||
<<.tip """Note that filter runs used with the `:sort` prefix ''should return the same number of items that they are passed''. In particular, when retrieving the value of a field with the [[get Operator]] it is helpful to guard against a missing field value using the [[else Operator]]. For example `...[get[myfield]else[default-value]]`.<br><br> | ||
|
||
Any ''missing'' entries will be treated as ''zero'' or the ''empty string''.""">> | ||
|
||
Also see: <<.olink sortsub>> Operator | ||
|
||
[[Examples|Sort Filter Run Prefix (Examples)]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters