TiddlyWiki5/editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid

39 lines
2.4 KiB
Plaintext
Raw Normal View History

created: 20210428083929749
Improve Filter Syntax documentation (#7368) * Improve Filter Syntax documentaion / navigation * update links and missing diagrams * rename legacy prefix to shortcut prefix * Update editions/tw5.com/tiddlers/filters/Filter Operators.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * add most changes a suggested by yaisog * fix copy / paste from-version * replace operand with parameter in the docs * fix typo * fix typos and improve railroad diagrams consistency * move "new from version" info for filter run prefixes below the table * fix typo transclusion and substitution * Move Filters tiddler to the top level in the TOC * wip-breadcrumbs * breadcrumbs & breadcrumbsList macro final * remove files that do not belong to this PR * restore release banner * add simple / story mode to breadcrumbs * .breadcrumbs macro update comments * new breadcrumbs CSS, woks with small screens * make CSS configurable using hidden-settings * improve CSS fro small screens * remove the initial: recursiveParentTag macro * improve location info for breadcrumbs nav. add "alt-text" for Edge ::after element * breadcrumbs add mode=field * bc add initial docs * breadcrumbsField will also respect the story ordering * add configurable global filterMode setting * improve arrow CSS for browser zooming * add bc links use bc-caption if caption field is non-empty * breadcrumbs improve comments * breadcrumbs aria-lable uses caption if there is one * breadcrumbs improve documentation * breadcrumbs improve docs for sort param * fix showArrows docs * remove .bc-link aria-label .. it's not needed if caption is resolved properly * use subfilter instead of enlist to evaluate the "excluded" variable. Be consistent with toc-macros * remove breadcrumbs macros - they have their own PR now * resolve conflict * add back doc-macros tiddler * integrate :then filter run prefix * remove .breadcrumbs macros and their config tiddlers * fix typos as requested --------- Co-authored-by: yaisog <m@rcuswinter.de>
2024-02-14 16:20:32 +00:00
from-version: 5.2.0
2024-03-12 20:54:45 +00:00
modified: 20240312203002082
Improve Filter Syntax documentation (#7368) * Improve Filter Syntax documentaion / navigation * update links and missing diagrams * rename legacy prefix to shortcut prefix * Update editions/tw5.com/tiddlers/filters/Filter Operators.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * add most changes a suggested by yaisog * fix copy / paste from-version * replace operand with parameter in the docs * fix typo * fix typos and improve railroad diagrams consistency * move "new from version" info for filter run prefixes below the table * fix typo transclusion and substitution * Move Filters tiddler to the top level in the TOC * wip-breadcrumbs * breadcrumbs & breadcrumbsList macro final * remove files that do not belong to this PR * restore release banner * add simple / story mode to breadcrumbs * .breadcrumbs macro update comments * new breadcrumbs CSS, woks with small screens * make CSS configurable using hidden-settings * improve CSS fro small screens * remove the initial: recursiveParentTag macro * improve location info for breadcrumbs nav. add "alt-text" for Edge ::after element * breadcrumbs add mode=field * bc add initial docs * breadcrumbsField will also respect the story ordering * add configurable global filterMode setting * improve arrow CSS for browser zooming * add bc links use bc-caption if caption field is non-empty * breadcrumbs improve comments * breadcrumbs aria-lable uses caption if there is one * breadcrumbs improve documentation * breadcrumbs improve docs for sort param * fix showArrows docs * remove .bc-link aria-label .. it's not needed if caption is resolved properly * use subfilter instead of enlist to evaluate the "excluded" variable. Be consistent with toc-macros * remove breadcrumbs macros - they have their own PR now * resolve conflict * add back doc-macros tiddler * integrate :then filter run prefix * remove .breadcrumbs macros and their config tiddlers * fix typos as requested --------- Co-authored-by: yaisog <m@rcuswinter.de>
2024-02-14 16:20:32 +00:00
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
tags: [[Named Filter Run Prefix]]
title: Sort Filter Run Prefix
type: text/vnd.tiddlywiki
Improve Filter Syntax documentation (#7368) * Improve Filter Syntax documentaion / navigation * update links and missing diagrams * rename legacy prefix to shortcut prefix * Update editions/tw5.com/tiddlers/filters/Filter Operators.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * add most changes a suggested by yaisog * fix copy / paste from-version * replace operand with parameter in the docs * fix typo * fix typos and improve railroad diagrams consistency * move "new from version" info for filter run prefixes below the table * fix typo transclusion and substitution * Move Filters tiddler to the top level in the TOC * wip-breadcrumbs * breadcrumbs & breadcrumbsList macro final * remove files that do not belong to this PR * restore release banner * add simple / story mode to breadcrumbs * .breadcrumbs macro update comments * new breadcrumbs CSS, woks with small screens * make CSS configurable using hidden-settings * improve CSS fro small screens * remove the initial: recursiveParentTag macro * improve location info for breadcrumbs nav. add "alt-text" for Edge ::after element * breadcrumbs add mode=field * bc add initial docs * breadcrumbsField will also respect the story ordering * add configurable global filterMode setting * improve arrow CSS for browser zooming * add bc links use bc-caption if caption field is non-empty * breadcrumbs improve comments * breadcrumbs aria-lable uses caption if there is one * breadcrumbs improve documentation * breadcrumbs improve docs for sort param * fix showArrows docs * remove .bc-link aria-label .. it's not needed if caption is resolved properly * use subfilter instead of enlist to evaluate the "excluded" variable. Be consistent with toc-macros * remove breadcrumbs macros - they have their own PR now * resolve conflict * add back doc-macros tiddler * integrate :then filter run prefix * remove .breadcrumbs macros and their config tiddlers * fix typos as requested --------- Co-authored-by: yaisog <m@rcuswinter.de>
2024-02-14 16:20:32 +00:00
<$railroad text="""
\start none
\end none
2024-03-12 20:54:45 +00:00
( ( ":sort" )
Improve Filter Syntax documentation (#7368) * Improve Filter Syntax documentaion / navigation * update links and missing diagrams * rename legacy prefix to shortcut prefix * Update editions/tw5.com/tiddlers/filters/Filter Operators.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * add most changes a suggested by yaisog * fix copy / paste from-version * replace operand with parameter in the docs * fix typo * fix typos and improve railroad diagrams consistency * move "new from version" info for filter run prefixes below the table * fix typo transclusion and substitution * Move Filters tiddler to the top level in the TOC * wip-breadcrumbs * breadcrumbs & breadcrumbsList macro final * remove files that do not belong to this PR * restore release banner * add simple / story mode to breadcrumbs * .breadcrumbs macro update comments * new breadcrumbs CSS, woks with small screens * make CSS configurable using hidden-settings * improve CSS fro small screens * remove the initial: recursiveParentTag macro * improve location info for breadcrumbs nav. add "alt-text" for Edge ::after element * breadcrumbs add mode=field * bc add initial docs * breadcrumbsField will also respect the story ordering * add configurable global filterMode setting * improve arrow CSS for browser zooming * add bc links use bc-caption if caption field is non-empty * breadcrumbs improve comments * breadcrumbs aria-lable uses caption if there is one * breadcrumbs improve documentation * breadcrumbs improve docs for sort param * fix showArrows docs * remove .bc-link aria-label .. it's not needed if caption is resolved properly * use subfilter instead of enlist to evaluate the "excluded" variable. Be consistent with toc-macros * remove breadcrumbs macros - they have their own PR now * resolve conflict * add back doc-macros tiddler * integrate :then filter run prefix * remove .breadcrumbs macros and their config tiddlers * fix typos as requested --------- Co-authored-by: yaisog <m@rcuswinter.de>
2024-02-14 16:20:32 +00:00
( : ":string" | ":alphanumeric" | ":number" | ":integer" | ":version" | ":date" )
2024-03-12 20:54:45 +00:00
( : ":casesensitive" /"required for string and alphanumeric"/ | ":caseinsensitive" /"required for string and alphanumeric"/ | ":reverse" /"optional"/ | - ) | - )
Improve Filter Syntax documentation (#7368) * Improve Filter Syntax documentaion / navigation * update links and missing diagrams * rename legacy prefix to shortcut prefix * Update editions/tw5.com/tiddlers/filters/Filter Operators.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * add most changes a suggested by yaisog * fix copy / paste from-version * replace operand with parameter in the docs * fix typo * fix typos and improve railroad diagrams consistency * move "new from version" info for filter run prefixes below the table * fix typo transclusion and substitution * Move Filters tiddler to the top level in the TOC * wip-breadcrumbs * breadcrumbs & breadcrumbsList macro final * remove files that do not belong to this PR * restore release banner * add simple / story mode to breadcrumbs * .breadcrumbs macro update comments * new breadcrumbs CSS, woks with small screens * make CSS configurable using hidden-settings * improve CSS fro small screens * remove the initial: recursiveParentTag macro * improve location info for breadcrumbs nav. add "alt-text" for Edge ::after element * breadcrumbs add mode=field * bc add initial docs * breadcrumbsField will also respect the story ordering * add configurable global filterMode setting * improve arrow CSS for browser zooming * add bc links use bc-caption if caption field is non-empty * breadcrumbs improve comments * breadcrumbs aria-lable uses caption if there is one * breadcrumbs improve documentation * breadcrumbs improve docs for sort param * fix showArrows docs * remove .bc-link aria-label .. it's not needed if caption is resolved properly * use subfilter instead of enlist to evaluate the "excluded" variable. Be consistent with toc-macros * remove breadcrumbs macros - they have their own PR now * resolve conflict * add back doc-macros tiddler * integrate :then filter run prefix * remove .breadcrumbs macros and their config tiddlers * fix typos as requested --------- Co-authored-by: yaisog <m@rcuswinter.de>
2024-02-14 16:20:32 +00:00
[[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.
Improve Filter Syntax documentation (#7368) * Improve Filter Syntax documentaion / navigation * update links and missing diagrams * rename legacy prefix to shortcut prefix * Update editions/tw5.com/tiddlers/filters/Filter Operators.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * Update editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid Co-authored-by: yaisog <m@rcuswinter.de> * add most changes a suggested by yaisog * fix copy / paste from-version * replace operand with parameter in the docs * fix typo * fix typos and improve railroad diagrams consistency * move "new from version" info for filter run prefixes below the table * fix typo transclusion and substitution * Move Filters tiddler to the top level in the TOC * wip-breadcrumbs * breadcrumbs & breadcrumbsList macro final * remove files that do not belong to this PR * restore release banner * add simple / story mode to breadcrumbs * .breadcrumbs macro update comments * new breadcrumbs CSS, woks with small screens * make CSS configurable using hidden-settings * improve CSS fro small screens * remove the initial: recursiveParentTag macro * improve location info for breadcrumbs nav. add "alt-text" for Edge ::after element * breadcrumbs add mode=field * bc add initial docs * breadcrumbsField will also respect the story ordering * add configurable global filterMode setting * improve arrow CSS for browser zooming * add bc links use bc-caption if caption field is non-empty * breadcrumbs improve comments * breadcrumbs aria-lable uses caption if there is one * breadcrumbs improve documentation * breadcrumbs improve docs for sort param * fix showArrows docs * remove .bc-link aria-label .. it's not needed if caption is resolved properly * use subfilter instead of enlist to evaluate the "excluded" variable. Be consistent with toc-macros * remove breadcrumbs macros - they have their own PR now * resolve conflict * add back doc-macros tiddler * integrate :then filter run prefix * remove .breadcrumbs macros and their config tiddlers * fix typos as requested --------- Co-authored-by: yaisog <m@rcuswinter.de>
2024-02-14 16:20:32 +00:00
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:
```
: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`).
** ''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]...`.
[[Examples|Sort Filter Run Prefix (Examples)]]