From bc3132ab2cddcf10895d494a1279a00f0510682c Mon Sep 17 00:00:00 2001 From: Mateusz Wilczek <36714554+mateuszwilczek@users.noreply.github.com> Date: Fri, 2 Feb 2024 18:15:51 +0100 Subject: [PATCH 1/3] Add explicit docs on temporary tiddlers (#7957) --- editions/tw5.com/tiddlers/Temporary Tiddlers.tid | 8 ++++++++ .../tw5.com/tiddlers/nodejs/Naming of System Tiddlers.tid | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 editions/tw5.com/tiddlers/Temporary Tiddlers.tid diff --git a/editions/tw5.com/tiddlers/Temporary Tiddlers.tid b/editions/tw5.com/tiddlers/Temporary Tiddlers.tid new file mode 100644 index 000000000..c138bf8a3 --- /dev/null +++ b/editions/tw5.com/tiddlers/Temporary Tiddlers.tid @@ -0,0 +1,8 @@ +created: 20240202112358997 +modified: 20240202120248326 +tags: Concepts +title: Temporary Tiddlers + +Temporary tiddlers are tiddlers that will be discarded when TiddlyWiki is saved. Under default configuration of the SavingMechanism (more specifically, the filter in [[$:/core/save/all]]), these are tiddlers prefixed with `$:/temp/`. This prefix makes them SystemTiddlers as well. + +One example usage of temporary tiddlers is storing the search queries. The query typed in the [[$:/AdvancedSearch]] is stored in [[$:/temp/advancedsearch]]. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/nodejs/Naming of System Tiddlers.tid b/editions/tw5.com/tiddlers/nodejs/Naming of System Tiddlers.tid index f677c6cee..ff1a79c78 100644 --- a/editions/tw5.com/tiddlers/nodejs/Naming of System Tiddlers.tid +++ b/editions/tw5.com/tiddlers/nodejs/Naming of System Tiddlers.tid @@ -1,5 +1,5 @@ created: 20140112190154121 -modified: 20140912142655205 +modified: 20240202121048363 tags: SystemTiddlers title: Naming of System Tiddlers type: text/vnd.tiddlywiki @@ -17,11 +17,11 @@ The system tiddlers provided as part of the core are named according to the foll |`$:/core/wiki/*` |lowercase |Metadata about the entire wiki | |`$:/docs/*` |lowercase |Documentation tiddlers | |`$:/messages/*` |~CamelCase |System messages | -|`$:/plugins/*` |lowercase |Plugin tiddlers, and plugin content | +|`$:/plugins/*` |lowercase |[[Plugin|Plugins]] tiddlers, and plugin content | |`$:/snippets/*` |//inconsistent// |Reusable snippets (will be replaced by macros) | -|`$:/state/*` |lowercase |User interface state tiddlers | +|`$:/state/*` |lowercase |User interface state tiddlers (see StateMechanism) | |`$:/tags/*` |~CamelCase |User interface configuration tags | -|`$:/temp/*` |lowercase |Temporary tiddlers that shouldn't be saved | +|`$:/temp/*` |lowercase |[[Temporary tiddlers|Temporary Tiddlers]] that shouldn't be saved | |`$:/themes/*` |lowercase |Theme plugins | In the format column: From abab9164c5934f99a570d9feb60b2e9f7718ccda Mon Sep 17 00:00:00 2001 From: eschlon Date: Sat, 10 Feb 2024 05:45:06 -0800 Subject: [PATCH 2/3] Signing the CLA (#7974) --- licenses/cla-individual.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/licenses/cla-individual.md b/licenses/cla-individual.md index 30136b6bb..5f7a833c3 100644 --- a/licenses/cla-individual.md +++ b/licenses/cla-individual.md @@ -559,3 +559,5 @@ Wang Ke, @Gk0Wk, 2023/10/17 @etardiff, 2023/12/10 John Long, @drevarr, 2023/12/12 + +Ed Holsinger, @eschlon, 2024/02/08 From a49436160d790fc4b0b4fd1dc57ce3c9c9466545 Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Wed, 14 Feb 2024 17:20:32 +0100 Subject: [PATCH 3/3] 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 * Update editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid Co-authored-by: yaisog * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog * Update editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid Co-authored-by: yaisog * Update editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix.tid Co-authored-by: yaisog * Update editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid Co-authored-by: yaisog * 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 --- core/language/en-GB/Docs/ModuleTypes.multids | 2 +- core/language/en-GB/Misc.multids | 2 +- editions/tw5.com/tiddlers/$__StoryList.tid | 5 - .../tw5.com/tiddlers/concepts/Filters.tid | 6 +- .../tiddlers/concepts/TextReference.tid | 4 +- .../tw5.com/tiddlers/definitions/Legacy.tid | 9 ++ .../filters/Conditional Operators.tid | 10 +- .../tiddlers/filters/Filter Operators.tid | 19 ++- .../filters/Mathematics Operators.tid | 4 +- editions/tw5.com/tiddlers/filters/add.tid | 4 +- editions/tw5.com/tiddlers/filters/all.tid | 12 +- editions/tw5.com/tiddlers/filters/append.tid | 6 +- .../tw5.com/tiddlers/filters/charcode.tid | 4 +- .../tiddlers/filters/compare Operator.tid | 4 +- .../tiddlers/filters/cycle Operator.tid | 2 +- .../tiddlers/filters/divide Operator.tid | 2 +- .../tiddlers/filters/enlist Operator.tid | 4 +- .../filters/enlist-input Operator.tid | 2 +- .../tiddlers/filters/examples/prepend.tid | 4 +- .../subfilter Operator (Examples).tid | 2 +- editions/tw5.com/tiddlers/filters/field.tid | 22 ++-- editions/tw5.com/tiddlers/filters/format.tid | 12 +- .../tw5.com/tiddlers/filters/jsonextract.tid | 4 +- editions/tw5.com/tiddlers/filters/jsonget.tid | 4 +- .../tw5.com/tiddlers/filters/jsonindexes.tid | 4 +- .../tw5.com/tiddlers/filters/jsontype.tid | 4 +- .../tw5.com/tiddlers/filters/log Operator.tid | 2 +- .../tiddlers/filters/match Operator.tid | 11 +- .../tw5.com/tiddlers/filters/max Operator.tid | 4 +- .../tw5.com/tiddlers/filters/min Operator.tid | 2 +- .../filters/moduleproperty Operator.tid | 2 +- editions/tw5.com/tiddlers/filters/modules.tid | 2 +- .../tiddlers/filters/multiply Operator.tid | 2 +- .../tiddlers/filters/power Operator.tid | 2 +- editions/tw5.com/tiddlers/filters/prefix.tid | 21 ++-- editions/tw5.com/tiddlers/filters/prepend.tid | 4 +- editions/tw5.com/tiddlers/filters/range.tid | 22 ++-- editions/tw5.com/tiddlers/filters/reduce.tid | 4 +- .../tiddlers/filters/remainder Operator.tid | 2 +- editions/tw5.com/tiddlers/filters/remove.tid | 6 +- .../tw5.com/tiddlers/filters/removeprefix.tid | 19 ++- .../tw5.com/tiddlers/filters/removesuffix.tid | 19 ++- editions/tw5.com/tiddlers/filters/search.tid | 6 +- editions/tw5.com/tiddlers/filters/sortby.tid | 2 +- .../tiddlers/filters/subfilter Operator.tid | 6 +- .../tiddlers/filters/subtract Operator.tid | 2 +- editions/tw5.com/tiddlers/filters/suffix.tid | 21 ++-- .../filters/syntax/All Filter Run Prefix.tid | 18 +++ .../filters/syntax/And Filter Run Prefix.tid | 18 +++ .../Cascade Filter Run Prefix (Examples).tid | 4 +- .../syntax/Cascade Filter Run Prefix.tid | 23 ++-- .../filters/syntax/Else Filter Run Prefix.tid | 18 +++ .../syntax/Except Filter Run Prefix.tid | 18 +++ .../filters/syntax/Filter Expression.tid | 74 ++---------- .../Filter Filter Run Prefix (Examples).tid | 4 +- .../syntax/Filter Filter Run Prefix.tid | 33 ++--- .../filters/syntax/Filter Parameter.tid | 18 +-- .../syntax/Filter Run Prefix (Examples).tid | 4 +- .../filters/syntax/Filter Run Prefix.tid | 18 +++ .../tiddlers/filters/syntax/Filter Run.tid | 9 +- .../tiddlers/filters/syntax/Filter Step.tid | 32 +++-- .../tiddlers/filters/syntax/Filter Syntax.tid | 18 ++- .../filters/syntax/Filter Whitespace.tid | 8 +- .../Interchangeable Filter Run Prefixes.tid | 44 +++++++ ...ersection Filter Run Prefix (Examples).tid | 4 +- .../syntax/Intersection Filter Run Prefix.tid | 21 ++-- .../Map Filter Run Prefix (Examples).tid | 4 +- .../filters/syntax/Map Filter Run Prefix.tid | 37 +++--- .../syntax/Named Filter Run Prefix.tid | 38 +++++- .../filters/syntax/Or Filter Run Prefix.tid | 18 +++ .../Reduce Filter Run Prefix (Examples).tid | 4 +- .../syntax/Reduce Filter Run Prefix.tid | 37 +++--- .../syntax/Shortcut Filter Run Prefixes.tid | 29 +++++ .../Sort Filter Run Prefix (Examples).tid | 4 +- .../filters/syntax/Sort Filter Run Prefix.tid | 25 ++-- .../filters/syntax/then Filter Run Prefix.tid | 39 +----- .../tiddlers/filters/toggle Operator.tid | 4 +- .../tiddlers/system/TableOfContents.tid | 4 +- .../tiddlers/system/filter-run-template.tid | 49 ++++++++ .../tiddlers/system/operator-template.tid | 113 ++++++++---------- .../Transclusion and Substitution.tid | 4 +- 81 files changed, 669 insertions(+), 444 deletions(-) delete mode 100644 editions/tw5.com/tiddlers/$__StoryList.tid create mode 100644 editions/tw5.com/tiddlers/definitions/Legacy.tid create mode 100644 editions/tw5.com/tiddlers/filters/syntax/All Filter Run Prefix.tid create mode 100644 editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid create mode 100644 editions/tw5.com/tiddlers/filters/syntax/Else Filter Run Prefix.tid create mode 100644 editions/tw5.com/tiddlers/filters/syntax/Except Filter Run Prefix.tid create mode 100644 editions/tw5.com/tiddlers/filters/syntax/Filter Run Prefix.tid create mode 100644 editions/tw5.com/tiddlers/filters/syntax/Interchangeable Filter Run Prefixes.tid create mode 100644 editions/tw5.com/tiddlers/filters/syntax/Or Filter Run Prefix.tid create mode 100644 editions/tw5.com/tiddlers/filters/syntax/Shortcut Filter Run Prefixes.tid create mode 100644 editions/tw5.com/tiddlers/system/filter-run-template.tid diff --git a/core/language/en-GB/Docs/ModuleTypes.multids b/core/language/en-GB/Docs/ModuleTypes.multids index 9a03d8887..5d5902c76 100644 --- a/core/language/en-GB/Docs/ModuleTypes.multids +++ b/core/language/en-GB/Docs/ModuleTypes.multids @@ -9,7 +9,7 @@ config: Data to be inserted into `$tw.config`. filteroperator: Individual filter operator methods. global: Global data to be inserted into `$tw`. info: Publishes system information via the [[$:/temp/info-plugin]] pseudo-plugin. -isfilteroperator: Operands for the ''is'' filter operator. +isfilteroperator: Parameters for the ''is'' filter operator. library: Generic module type for general purpose JavaScript modules. macro: JavaScript macro definitions. parser: Parsers for different content types. diff --git a/core/language/en-GB/Misc.multids b/core/language/en-GB/Misc.multids index 2c10d1acb..b5e6e2374 100644 --- a/core/language/en-GB/Misc.multids +++ b/core/language/en-GB/Misc.multids @@ -30,7 +30,7 @@ Error/DeserializeOperator/UnknownDeserializer: Filter Error: Unknown deserialize Error/Filter: Filter error Error/FilterSyntax: Syntax error in filter expression Error/FilterRunPrefix: Filter Error: Unknown prefix for filter run -Error/IsFilterOperator: Filter Error: Unknown operand for the 'is' filter operator +Error/IsFilterOperator: Filter Error: Unknown parameter for the 'is' filter operator Error/FormatFilterOperator: Filter Error: Unknown suffix for the 'format' filter operator Error/LoadingPluginLibrary: Error loading plugin library Error/NetworkErrorAlert: `

''Network Error''

It looks like the connection to the server has been lost. This may indicate a problem with your network connection. Please attempt to restore network connectivity before continuing.

''Any unsaved changes will be automatically synchronised when connectivity is restored''.` diff --git a/editions/tw5.com/tiddlers/$__StoryList.tid b/editions/tw5.com/tiddlers/$__StoryList.tid deleted file mode 100644 index 37ea75152..000000000 --- a/editions/tw5.com/tiddlers/$__StoryList.tid +++ /dev/null @@ -1,5 +0,0 @@ -created: 20220728145919904 -list: Brackets Base64 HelloThere GettingStarted Community -modified: 20220728145919904 -title: $:/StoryList -type: text/vnd.tiddlywiki \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/concepts/Filters.tid b/editions/tw5.com/tiddlers/concepts/Filters.tid index b9fec39fc..3e7c0bd6a 100644 --- a/editions/tw5.com/tiddlers/concepts/Filters.tid +++ b/editions/tw5.com/tiddlers/concepts/Filters.tid @@ -1,7 +1,7 @@ created: 20130827080000000 list: [[Introduction to filter notation]] [[Filter Syntax]] -modified: 20220316145511797 -tags: Reference Concepts +modified: 20230710074511095 +tags: Reference Concepts TableOfContents title: Filters type: text/vnd.tiddlywiki @@ -15,7 +15,7 @@ You can think of TiddlyWiki as a database in which the records are tiddlers. A d A <<.def filter>> is a concise notation for selecting a particular [[set of tiddlers|Title Selection]], known as its <<.def "output">>. Whenever ~TiddlyWiki encounters a filter, it calculates the output. Further work can then be done with just those tiddlers, such as [[counting|CountWidget]] or [[listing|ListWidget]] them. -The following example passes a filter to the <<.mlink list-links>> macro to display a list of all tiddlers whose titles are <<.olink2 tagged tag>> with the word <<.word Filters>>: +The following example passes a filter to the <<.mlink list-links>> macro. It displays a list of all tiddlers using the <<.olink2 tag tag>> <<.word Filters>>: <>""" >> diff --git a/editions/tw5.com/tiddlers/concepts/TextReference.tid b/editions/tw5.com/tiddlers/concepts/TextReference.tid index 474149b88..cf2341a97 100644 --- a/editions/tw5.com/tiddlers/concepts/TextReference.tid +++ b/editions/tw5.com/tiddlers/concepts/TextReference.tid @@ -1,5 +1,5 @@ created: 20130827075900000 -modified: 20161216173541948 +modified: 20230321130421587 tags: Concepts title: TextReference type: text/vnd.tiddlywiki @@ -27,7 +27,7 @@ Text references can be used in several places: * As [[indirect parameters|Filter Parameter]] within [[Filters]] (eg, `<$list filter="[tag{MyTag!!name}]"/>`) * As [[indirect attributes|HTML in WikiText]] of an element or widget (eg, `<$widget attrib={{Title!!description}}/>`) -* As the operand of a shortcut transclusion (eg, `{{MyTiddler!!title}}`) +* As the parameter of a shortcut transclusion (eg, `{{MyTiddler!!title}}`) * As the `state` attribute of the RevealWidget and the LinkCatcherWidget <$macrocall $name=".tip" _="""Note the distinction between a text reference such as `foo!!bar` and a transclusion of a text reference such as `{{foo!!bar}}`"""/> diff --git a/editions/tw5.com/tiddlers/definitions/Legacy.tid b/editions/tw5.com/tiddlers/definitions/Legacy.tid new file mode 100644 index 000000000..325f9e809 --- /dev/null +++ b/editions/tw5.com/tiddlers/definitions/Legacy.tid @@ -0,0 +1,9 @@ +created: 20230319131443509 +modified: 20230319132235520 +tags: Definitions +title: Legacy +type: text/vnd.tiddlywiki + +>Legacy code is old computer source code that is no longer supported on the standard hardware and environments, and is a codebase that is in some respect obsolete or supporting something obsolete. Legacy code may be written in programming languages, use frameworks and external libraries, or use architecture and patterns that are no longer considered modern, increasing the mental burden and ramp-up time for software engineers who work on the codebase. +> +>https://en.wikipedia.org/wiki/Legacy_system \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/filters/Conditional Operators.tid b/editions/tw5.com/tiddlers/filters/Conditional Operators.tid index 6d21e0864..a8dc5a1b2 100644 --- a/editions/tw5.com/tiddlers/filters/Conditional Operators.tid +++ b/editions/tw5.com/tiddlers/filters/Conditional Operators.tid @@ -1,10 +1,10 @@ created: 20190802113703788 -modified: 20230501175143648 +modified: 20230711082337975 tags: Filters title: Conditional Operators type: text/vnd.tiddlywiki -<<.from-version "5.1.20">>The conditional filter operators allow for ''if-then-else'' logic to be expressed within filters. +<<.from-version "5.1.20">> The conditional filter operators allow ''if-then-else'' logic to be expressed within filters. The foundation is the convention that an empty list can be used to represent the Boolean value <<.value false>> and a list with at one (or more) entries to represent <<.value true>>. @@ -25,6 +25,8 @@ The <<.olink else>> operator can be used to apply a defaults for missing values. <<.operator-example 2 "[[HelloThere]get[custom-field]else[default-value]]">> -! Filter Run Prefixes +''Filter Run Prefixes'' -The [[:then|:then Filter Run Prefix]] and [[:else|:else Filter Run Prefix]] filter run prefixes serve a similar purpose as the conditional operators. Refer to their documentation for more information. \ No newline at end of file +The [[:then|Then Filter Run Prefix]] and [[:else|Else Filter Run Prefix]] named filter run prefixes serve a similar purpose as the conditional operators. + +Also see: [[Named Filter Run Prefix]] diff --git a/editions/tw5.com/tiddlers/filters/Filter Operators.tid b/editions/tw5.com/tiddlers/filters/Filter Operators.tid index 0738c7103..35d80607f 100644 --- a/editions/tw5.com/tiddlers/filters/Filter Operators.tid +++ b/editions/tw5.com/tiddlers/filters/Filter Operators.tid @@ -1,5 +1,6 @@ +breadcrumbs: [[Filter Step]] created: 20140410103123179 -modified: 20211217141224284 +modified: 20230410114132501 tags: Filters title: Filter Operators type: text/vnd.tiddlywiki @@ -18,13 +19,19 @@ type: text/vnd.tiddlywiki $_$ \end -A <<.def "filter operator">> is a predefined keyword attached to an individual [[step|Filter Step]] of a [[filter|Filters]]. It defines the particular action of that step. +A <<.def "filter operator">> is a predefined keyword attached to an individual step of a [[filter|Filters]]. It defines the particular action of that step. -''Important:'' Each first [[step|Filter Step]] of a [[filter run|Filter Run]] not given any input titles receives the output of <$link to="all Operator">[all[tiddlers]] as its input. +''Important:'' In general, each first [[filter step|Filter Step]] of a [[filter run|Filter Run]] not given any input titles receives the output of <$link to="all Operator">[all[tiddlers]] as its input. -The following table lists all core operators, the most common ones marked ✓. The `!` column indicates whether an operator allows ''negation'' using the <$link to="Filter Step">! prefix. For specifics as to each operator's negated output please refer to its documentation. -Most steps process the [[selection of titles|Title Selection]] that are supplied as their input, but a few [[construct an entirely new selection|Selection Constructors]] instead, as indicated by the last column. A `C?` indicates it might construct a new selection, depending on usage. For specifics as to each operator's selection creation please refer to its documentation. +''Table legend:'' + +|tc-table-no-border tc-first-col-min-width|k +|^ ✓|^... |,Used to mark the most common ones | +|^ `!`|^... |,The column indicates whether an operator allows ''negation'' using the <$link to="Filter Step">! prefix.
For specifics as to each operator's negated output please refer to its documentation | +|^ `C`|^... |,Most steps process the [[selection of titles|Title Selection]] that are supplied as their input, but a few [[construct an entirely new selection|Selection Constructors]] instead, as indicated by the last column.
A `C?` indicates it might construct a new selection, depending on usage. For specifics as to each operator's selection creation please refer to its documentation | + +The following table lists all core operators: @@ -49,6 +56,6 @@ Most steps process the [[selection of titles|Title Selection]] that are supplied <<.operator-rows "[tag[Filter Operators]!tag[Order Operators]!tag[Mathematics Operators]!tag[String Operators]!tag[Tag Operators]tag[Special Operators]sort[]]">>
-A typical step is written as `[operator[parameter]]`, although not all of the operators need a [[parameter|Filter Parameter]]. +A typical step is written as `[operator[parameter]]`, although not all of the operators need a [[parameter|Filter Parameter]]. For the exact rules, see [[Filter Syntax]]. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/filters/Mathematics Operators.tid b/editions/tw5.com/tiddlers/filters/Mathematics Operators.tid index 94f89a267..4c0160b90 100644 --- a/editions/tw5.com/tiddlers/filters/Mathematics Operators.tid +++ b/editions/tw5.com/tiddlers/filters/Mathematics Operators.tid @@ -1,5 +1,5 @@ created: 20190206140446821 -modified: 20220330133748666 +modified: 20230321133008898 tags: Filters title: Mathematics Operators type: text/vnd.tiddlywiki @@ -22,7 +22,7 @@ The mathematics operators take three different forms: ** <<.inline-operator-example "=1 =2 =3 =4 +[negate[]]">> ** <<.inline-operator-example "=1.2 =2.4 =3.6 =4.8 +[trunc[]]">> ** <<.inline-operator-example "=1.2 =2.4 =3.6 =4.8 +[round[]]">> -* ''Binary operators'' apply an operation and operand to each number in the input list (e.g. add, multiply, remainder) +* ''Binary operators'' apply an operation and parameter to each number in the input list (e.g. add, multiply, remainder) ** <<.inline-operator-example "=1 =2 =3 =4 +[add[3]]">> ** <<.inline-operator-example "=1 =2 =3 =4 +[multiply[8]]">> * ''Reducing operators'' apply an operation to all of the numbers in the input list, returning a single result (e.g. sum, product) diff --git a/editions/tw5.com/tiddlers/filters/add.tid b/editions/tw5.com/tiddlers/filters/add.tid index 3bed37537..e808ced7c 100644 --- a/editions/tw5.com/tiddlers/filters/add.tid +++ b/editions/tw5.com/tiddlers/filters/add.tid @@ -1,11 +1,11 @@ caption: add created: 20190206140446821 -modified: 20190611125053329 +modified: 20230321130647487 op-input: a [[selection of titles|Title Selection]] op-output: the input as numbers, but with <<.place N>> added to each one op-parameter: a number op-parameter-name: N -op-purpose: treating each input title as a number, add to each the numeric value of the operand +op-purpose: treating each input title as a number, add to each the numeric value of the parameter tags: [[Filter Operators]] [[Mathematics Operators]] [[Binary Mathematics Operators]] title: add Operator type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/all.tid b/editions/tw5.com/tiddlers/filters/all.tid index 21b65e651..5d65ca6ab 100644 --- a/editions/tw5.com/tiddlers/filters/all.tid +++ b/editions/tw5.com/tiddlers/filters/all.tid @@ -1,6 +1,6 @@ caption: all created: 20140410103123179 -modified: 20211217135719266 +modified: 20230321131457669 op-input: ignored, unless the parameter is empty op-output: the titles that belong to all the specified categories op-parameter: zero or more categories @@ -9,10 +9,14 @@ tags: [[Filter Operators]] [[Common Operators]] [[Selection Constructors]] [[Sel title: all Operator type: text/vnd.tiddlywiki -The parameter specifies zero or more fundamental categories using the following syntax: +The parameter specifies zero or more fundamental categories using the following [[filter step|Filter Step]] syntax: <$railroad text=""" -[{: ("current" | "missing" |: "orphans" | "shadows" | "tags" | "tiddlers" ) +"+" }] +\start none +\end none +<-"all"-> ( "[" | "<" | "{" ) + [{: ("current" | "missing" |: "orphans" | "shadows" | "tags" | "tiddlers" ) +"+" }] + ( "]" | ">" | "}" ) """/> |!Category |!Members |!Sorted | @@ -25,7 +29,7 @@ The parameter specifies zero or more fundamental categories using the following If the parameter specifies more than one category, they are processed from left to right. The overall output is initially empty, and each category's output is [[dominantly appended|Dominant Append]] to it in turn. Unrecognised categories contribute nothing to the output. -As a special case, if the parameter is empty, the output is simply a copy of the input. This can be useful when the parameter is [[soft|Filter Parameter]]. +As a special case, if the parameter is empty, the output is simply a copy of the input. This can be useful when the parameter is a [[soft parameter|Filter Parameter]]. The <<.olink is>> operator is similar, but its scope is restricted to its input. diff --git a/editions/tw5.com/tiddlers/filters/append.tid b/editions/tw5.com/tiddlers/filters/append.tid index 881dfc257..840206aae 100644 --- a/editions/tw5.com/tiddlers/filters/append.tid +++ b/editions/tw5.com/tiddlers/filters/append.tid @@ -1,9 +1,9 @@ caption: append created: 20151017145358368 -modified: 20151108051540981 +modified: 20230321131631510 op-input: a list of items -op-neg-output: a list with items appended from the tail of the operand array -op-output: a list with items appended from the head of the operand array +op-neg-output: a list with items appended from the tail of the parameter array +op-output: a list with items appended from the head of the parameter array op-parameter: the array of items to be appended to the tail of the list op-parameter-name: list op-purpose: append a range of items from an array to the list diff --git a/editions/tw5.com/tiddlers/filters/charcode.tid b/editions/tw5.com/tiddlers/filters/charcode.tid index 3cb82bc68..2b64536b0 100644 --- a/editions/tw5.com/tiddlers/filters/charcode.tid +++ b/editions/tw5.com/tiddlers/filters/charcode.tid @@ -2,7 +2,7 @@ caption: charcode created: 20210622214425635 modified: 20210622214425635 op-input: ignored -op-output: a string formed from concatenating the characters specified by the numeric codes given in the operand(s) +op-output: a string formed from concatenating the characters specified by the numeric codes given in the parameter(s) op-parameter: numeric character code op-parameter-name: C op-purpose: generates string characters from their numeric character codes @@ -12,6 +12,6 @@ type: text/vnd.tiddlywiki <<.from-version "5.2.0">> -This operator returns a string formed from concatenating the characters specified by the numeric codes given in one or more operands. It is useful for generating special characters such as tab (`charcode[9]`) or new line (`charcode[13],[10]`). +This operator returns a string formed from concatenating the characters specified by the numeric codes given in one or more parameters. It is useful for generating special characters such as tab (`charcode[9]`) or new line (`charcode[13],[10]`). <<.operator-examples "charcode">> diff --git a/editions/tw5.com/tiddlers/filters/compare Operator.tid b/editions/tw5.com/tiddlers/filters/compare Operator.tid index 95bdce2a9..debf09ead 100644 --- a/editions/tw5.com/tiddlers/filters/compare Operator.tid +++ b/editions/tw5.com/tiddlers/filters/compare Operator.tid @@ -4,7 +4,7 @@ tags: [[Filter Operators]] [[Mathematics Operators]] [[String Operators]] [[Nega title: compare Operator type: text/vnd.tiddlywiki caption: compare -op-purpose: filter the input by comparing each item against the operand +op-purpose: filter the input by comparing each item against the parameter op-input: a [[selection of titles|Title Selection]] op-suffix: the <<.op compare>> operator uses a rich suffix, see below for details op-parameter: the value to compare @@ -16,7 +16,7 @@ op-neg-output: those input titles <<.em not>> matching the specified comparison The <<.op compare>> operator uses an extended syntax to specify all the options: ``` -[compare::[]] +[compare::[]] ``` The ''type'' can be: diff --git a/editions/tw5.com/tiddlers/filters/cycle Operator.tid b/editions/tw5.com/tiddlers/filters/cycle Operator.tid index f54316f29..7cf76c28d 100644 --- a/editions/tw5.com/tiddlers/filters/cycle Operator.tid +++ b/editions/tw5.com/tiddlers/filters/cycle Operator.tid @@ -4,7 +4,7 @@ modified: 20201118192136472 op-input: a list of items op-output: the input list with the titles specified in the parameter toggled in a cyclical manner op-parameter: the <<.op cycle>> operator accepts 1 or 2 parameters, see below for details -op-purpose: toggle in the input, the titles specified in the first operand in a cyclical manner +op-purpose: toggle the titles specified in the first parameter in a cyclical manner tags: [[Filter Operators]] [[Listops Operators]] [[Order Operators]] title: cycle Operator type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/divide Operator.tid b/editions/tw5.com/tiddlers/filters/divide Operator.tid index 9218c9a99..b8b357861 100644 --- a/editions/tw5.com/tiddlers/filters/divide Operator.tid +++ b/editions/tw5.com/tiddlers/filters/divide Operator.tid @@ -5,7 +5,7 @@ op-input: a [[selection of titles|Title Selection]] op-output: the input as numbers, but with each one divided by <<.place N>> op-parameter: a number op-parameter-name: N -op-purpose: treating each input title as a number, divide them by the numeric value of the operand +op-purpose: treating each input title as a number, divide it by the numeric value of the parameter tags: [[Filter Operators]] [[Mathematics Operators]] [[Binary Mathematics Operators]] title: divide Operator type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/enlist Operator.tid b/editions/tw5.com/tiddlers/filters/enlist Operator.tid index e45e97c2a..a23a30e64 100644 --- a/editions/tw5.com/tiddlers/filters/enlist Operator.tid +++ b/editions/tw5.com/tiddlers/filters/enlist Operator.tid @@ -7,14 +7,14 @@ op-neg-output: those input titles that are <<.em not>> listed in <<.place L>> op-output: the titles stored as a [[title list|Title List]] at <<.place L>> op-parameter: a [[title list|Title List]] op-parameter-name: L -op-purpose: select titles from the operand interpreted as a [[title list|Title List]] +op-purpose: select titles from the parameter interpreted as a [[title list|Title List]] op-suffix: <<.from-version "5.1.20">> `dedupe` (the default) to remove duplicates, `raw` to leave duplicates untouched op-suffix-name: D tags: [[Filter Operators]] [[Field Operators]] [[Selection Constructors]] [[Negatable Operators]] title: enlist Operator type: text/vnd.tiddlywiki -<<.tip """Literal filter operands cannot contain square brackets but you can work around the issue by using a variable. ''Learn more at:'' [[SetWidget]] documentation under the heading "Filtered List Variable Assignment" """>> +<<.tip """Literal filter parameters cannot contain square brackets but you can work around the issue by using a variable. ''Learn more at:'' [[SetWidget]] documentation under the heading "Filtered List Variable Assignment" """>> ``` <$set name="myList" value="first [[second with a space]] third"> diff --git a/editions/tw5.com/tiddlers/filters/enlist-input Operator.tid b/editions/tw5.com/tiddlers/filters/enlist-input Operator.tid index 386723b51..aa35f8f1c 100644 --- a/editions/tw5.com/tiddlers/filters/enlist-input Operator.tid +++ b/editions/tw5.com/tiddlers/filters/enlist-input Operator.tid @@ -12,7 +12,7 @@ type: text/vnd.tiddlywiki <<.from-version "5.1.23">> -<<.tip " Compare with [[enlist|enlist Operator]] operator that interprets its operand as a title list">> +<<.tip " Compare with [[enlist|enlist Operator]] operator that interprets its parameter as a title list">> ``` <$vars days={{{ [[Days of the Week]get[list]] }}}> diff --git a/editions/tw5.com/tiddlers/filters/examples/prepend.tid b/editions/tw5.com/tiddlers/filters/examples/prepend.tid index 0c66d1002..57f73fc6f 100644 --- a/editions/tw5.com/tiddlers/filters/examples/prepend.tid +++ b/editions/tw5.com/tiddlers/filters/examples/prepend.tid @@ -1,5 +1,5 @@ created: 20151017151508135 -modified: 20151108051743531 +modified: 20230321130446467 tags: [[Operator Examples]] [[prepend Operator]] title: prepend Operator (Examples) type: text/vnd.tiddlywiki @@ -10,6 +10,6 @@ The operator may be used to prepend a number of items to the list. <<.operator-example 1 "[list[Days of the Week]prepend[Yesterday Today Tomorrow]]">> -The operand may list only items without spaces -- to include items with spaces, use a reference to an array e.g. prepend the last three short days of the week to the list +The parameter may list only items without spaces -- to include items with spaces, use a reference to an array, e.g. prepend the last three short days of the week to the list <<.operator-example 2 "[list[Days of the Week]!prepend:3{Days of the Week!!short}]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/subfilter Operator (Examples).tid b/editions/tw5.com/tiddlers/filters/examples/subfilter Operator (Examples).tid index eac8828a3..2ebe37db2 100644 --- a/editions/tw5.com/tiddlers/filters/examples/subfilter Operator (Examples).tid +++ b/editions/tw5.com/tiddlers/filters/examples/subfilter Operator (Examples).tid @@ -9,7 +9,7 @@ type: text/vnd.tiddlywiki ''<$text text=<<__name__>>/>'': <$text text={{{ [<__name__>getvariable[]] }}}/> \end -Literal filter operands can be used, but such cases are better rewritten without using <<.op subfilter>>: +Literal filter parameters can be used, but such cases are better rewritten without using <<.op subfilter>>: <<.operator-example 1 "[subfilter[one two three]addsuffix[!]]" "same as `one two three +[addsuffix[!]]`">> The <<.op subfilter>> operator can be used to dynamically define parts of a [[filter run|Filter Run]]. This is useful for sharing a common pieces of a filter across multiple filters. diff --git a/editions/tw5.com/tiddlers/filters/field.tid b/editions/tw5.com/tiddlers/filters/field.tid index 901f22feb..4f2f243e9 100644 --- a/editions/tw5.com/tiddlers/filters/field.tid +++ b/editions/tw5.com/tiddlers/filters/field.tid @@ -1,23 +1,23 @@ +caption: field created: 20140410103123179 -modified: 20150203184718000 +modified: 20230316111901766 +op-input: a [[selection of titles|Title Selection]] +op-neg-output: those input tiddlers in which field <<.place F>> does <<.em not>> have the value <<.place S>> +op-output: those input tiddlers in which field <<.place F>> has the value <<.place S>> +op-parameter: a possible value of field <<.place F>> +op-parameter-name: S +op-purpose: filter the input by field +op-suffix: the name of a [[field|TiddlerFields]] +op-suffix-name: F tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] [[Negatable Operators]] title: field Operator type: text/vnd.tiddlywiki -caption: field -op-purpose: filter the input by field -op-input: a [[selection of titles|Title Selection]] -op-suffix: the name of a [[field|TiddlerFields]] -op-suffix-name: F -op-parameter: a possible value of field <<.place F>> -op-parameter-name: S -op-output: those input tiddlers in which field <<.place F>> has the value <<.place S>> -op-neg-output: those input tiddlers in which field <<.place F>> does <<.em not>> have the value <<.place S>> If <<.place S>> is empty, <<.op field>> will match both of the following: * tiddlers that don't contain field <<.place F>> * tiddlers in which field <<.place F>> exists but has an empty value -The syntax of a [[filter step|Filter Step]] treats any unrecognised [[filter operator|Filter Operators]] as if it was the suffix to the <<.op field>> operator. See the <<.operator-examples "field" "examples">>. +The syntax of a [[filter step|Filter Step]] treats any unrecognised [[filter operator|Filter Operators]] as if it was the suffix to the <<.op field>> operator. <<.operator-examples "field">> diff --git a/editions/tw5.com/tiddlers/filters/format.tid b/editions/tw5.com/tiddlers/filters/format.tid index d62a82169..7d650ed0a 100644 --- a/editions/tw5.com/tiddlers/filters/format.tid +++ b/editions/tw5.com/tiddlers/filters/format.tid @@ -1,6 +1,6 @@ caption: format created: 20201020100834443 -modified: 20220611104737314 +modified: 20230321132245053 op-input: a [[selection of titles|Title Selection]] op-output: input strings formatted according to the specified suffix <<.place B>> op-parameter: optional format string for the formats @@ -16,11 +16,11 @@ type: text/vnd.tiddlywiki The suffix <<.place B>> is one of the following supported string formats: -|!Format |!Description | -|^`date` |The input string is interpreted as a UTC date and displayed according to the DateFormat specified in the optional operator operand. (Defaults to "YYYY MM DD 0hh:0mm") | -|^`json` |<<.from-version "5.2.4">> The input string is interpreted as JSON and displayed with standard formatting. The optional operator operand specifies the number of spaces to use for indenting, or a string to use for indenting. Nothing is returned if the input string is not valid JSON | -|^`relativedate` |The input string is interpreted as a UTC date and displayed as the interval from the present instant. Any operator parameters are ignored | -|^`timestamp` |<<.from-version "5.3.0">> The input string is interpreted as number of milliseconds since the [[ECMAScript epoch|https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps]], 1 January 1970, and displayed according to the DateFormat specified in the optional operator operand. (Defaults to "[UTC]YYYY0MM0DD0hh0mm0ss0XXX") | +|Format |Description |h +|^`date` |The input string is interpreted as a UTC date and displayed according to the DateFormat specified in the optional parameter <<.place C>>. (Defaults to "YYYY MM DD 0hh:0mm") | +|^`json` |<<.from-version "5.2.4">> The input string is interpreted as JSON and displayed with standard formatting. The optional parameter <<.place C>> specifies the number of spaces to use for indenting, or a string to use for indenting. Nothing is returned if the input string is not valid JSON | +|^`relativedate` |The input string is interpreted as a UTC date and displayed as the interval from the present instant. Any operator parameters <<.place C>> are ignored | +|^`timestamp` |<<.from-version "5.3.0">> The input string is interpreted as number of milliseconds since the [[ECMAScript epoch|https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps]], 1 January 1970, and displayed according to the DateFormat specified in the optional operator parameter. (Defaults to "[UTC]YYYY0MM0DD0hh0mm0ss0XXX") | |^`titlelist` |<<.from-version "5.2.0">> The input string wrapped in double square brackets if it contains a space. Appropriate for use in a [[title list|Title List]]. | Invalid input strings are dropped by the <<.op format>> operator. diff --git a/editions/tw5.com/tiddlers/filters/jsonextract.tid b/editions/tw5.com/tiddlers/filters/jsonextract.tid index 27724205f..a899ac6e6 100644 --- a/editions/tw5.com/tiddlers/filters/jsonextract.tid +++ b/editions/tw5.com/tiddlers/filters/jsonextract.tid @@ -43,7 +43,7 @@ Properties within a JSON object are identified by a sequence of indexes. In the The following examples assume that this JSON data is contained in a variable called `jsondata`. -The <<.op jsonextract>> operator uses multiple operands to specify the indexes of the property to retrieve. Values are returned as literal JSON strings: +The <<.op jsonextract>> operator uses multiple parameters to specify the indexes of the property to retrieve. Values are returned as literal JSON strings: ``` [jsonextract[a]] --> "one" @@ -67,7 +67,7 @@ Indexes can be dynamically composed from variables and transclusions: [jsonextract,{!!field},[0]] ``` -A subtlety is that the special case of a single blank operand is used to identify the root object. Thus: +A subtlety is that the special case of a single blank parameter is used to identify the root object. Thus: ``` [jsonextract[]] --> {"a":"one","b":"","c":"three","d":{"e":"four","f":["five","six",true,false,null],"g":{"x":"max","y":"may","z":"maize"}}} diff --git a/editions/tw5.com/tiddlers/filters/jsonget.tid b/editions/tw5.com/tiddlers/filters/jsonget.tid index c50cbd6f2..b1db4e308 100644 --- a/editions/tw5.com/tiddlers/filters/jsonget.tid +++ b/editions/tw5.com/tiddlers/filters/jsonget.tid @@ -43,7 +43,7 @@ Properties within a JSON object are identified by a sequence of indexes. In the The following examples assume that this JSON data is contained in a variable called `jsondata`. -The <<.op jsonget>> operator uses multiple operands to specify the indexes of the property to retrieve: +The <<.op jsonget>> operator uses multiple parameters to specify the indexes of the property to retrieve: ``` [jsonget[a]] --> "one" @@ -94,7 +94,7 @@ If the object or array contains nested child objects or arrays then the values a [jsonget[d]] --> "four","five","six","true","false","null","max","may","maize" ``` -A subtlety is that the special case of a single blank operand is used to identify the root object. Thus: +A subtlety is that the special case of a single blank parameter is used to identify the root object. Thus: ``` [jsonindexes[]] --> "a", "b", "c", "d" diff --git a/editions/tw5.com/tiddlers/filters/jsonindexes.tid b/editions/tw5.com/tiddlers/filters/jsonindexes.tid index 605936a2f..3b9962b5f 100644 --- a/editions/tw5.com/tiddlers/filters/jsonindexes.tid +++ b/editions/tw5.com/tiddlers/filters/jsonindexes.tid @@ -43,7 +43,7 @@ Properties within a JSON object are identified by a sequence of indexes. In the The following examples assume that this JSON data is contained in a variable called `jsondata`. -The <<.op jsonindexes>> operator uses multiple operands to specify the indexes of the property to retrieve: +The <<.op jsonindexes>> operator uses multiple parameters to specify the indexes of the property to retrieve: ``` [jsonindexes[d],[f]] --> "0", "1", "2", "3", "4" @@ -58,7 +58,7 @@ Indexes can be dynamically composed from variables and transclusions: Retrieving the indexes of JSON properties that are not objects or arrays will return nothing. -A subtlety is that the special case of a single blank operand is used to identify the root object. Thus: +A subtlety is that the special case of a single blank parameter is used to identify the root object. Thus: ``` [jsonindexes[]] --> "a", "b", "c", "d" diff --git a/editions/tw5.com/tiddlers/filters/jsontype.tid b/editions/tw5.com/tiddlers/filters/jsontype.tid index 6bff01914..d4561f0f5 100644 --- a/editions/tw5.com/tiddlers/filters/jsontype.tid +++ b/editions/tw5.com/tiddlers/filters/jsontype.tid @@ -52,7 +52,7 @@ Properties within a JSON object are identified by a sequence of indexes. In the The following examples assume that this JSON data is contained in a variable called `jsondata`. -The <<.op jsontype>> operator uses multiple operands to specify the indexes of the property whose type is to be retrieved: +The <<.op jsontype>> operator uses multiple parameters to specify the indexes of the property whose type is to be retrieved: ``` [jsontype[a]] --> "string" @@ -75,7 +75,7 @@ Indexes can be dynamically composed from variables and transclusions: [jsontype,{!!field},[0]] ``` -A subtlety is that the special case of a single blank operand is used to identify the root object. Thus: +A subtlety is that the special case of a single blank parameter is used to identify the root object. Thus: ``` [jsontype[]] --> "object" diff --git a/editions/tw5.com/tiddlers/filters/log Operator.tid b/editions/tw5.com/tiddlers/filters/log Operator.tid index bfca18853..bea10c539 100644 --- a/editions/tw5.com/tiddlers/filters/log Operator.tid +++ b/editions/tw5.com/tiddlers/filters/log Operator.tid @@ -5,7 +5,7 @@ op-input: a [[selection of titles|Title Selection]] op-output: the logarithm of each input title as numbers, with base <<.place N>> if specified otherwise base `e` op-parameter: a number op-parameter-name: N -op-purpose: treating each input title as a number, return its logarithm with base equal to the numeric value of the operand if specified, otherwise base `e` +op-purpose: treating each input title as a number, return its logarithm with base equal to the numeric value of the parameter if specified, otherwise base `e` tags: [[Filter Operators]] [[Mathematics Operators]] [[Binary Mathematics Operators]] title: log Operator type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/match Operator.tid b/editions/tw5.com/tiddlers/filters/match Operator.tid index 6e9997d3f..46b6e04f3 100644 --- a/editions/tw5.com/tiddlers/filters/match Operator.tid +++ b/editions/tw5.com/tiddlers/filters/match Operator.tid @@ -1,11 +1,11 @@ caption: match created: 20190731080209404 -modified: 20190731081047732 +modified: 20230711082432865 op-input: a [[selection of titles|Title Selection]] -op-neg-output: each item in the input list that does not match the operand string -op-output: each item in the input list that matches the operand string (potentially including duplicates) +op-neg-output: each item in the input list that does not match the parameter string +op-output: each item in the input list that matches the parameter string (potentially including duplicates) op-parameter: the string to be matched -op-purpose: returns each item in the list that matches the operand string +op-purpose: returns each item in the list that matches the parameter string op-suffix: the <<.op match>> operator uses a rich suffix, see below for details tags: [[Filter Operators]] title: match Operator @@ -16,11 +16,10 @@ type: text/vnd.tiddlywiki The <<.op match>> operator uses an extended syntax that permits multiple flags to be passed: ``` -[match:[]] +[match:[]] ``` * ''flag list'': a comma delimited list of flags -* ''operand'': filter operand The available flags are: diff --git a/editions/tw5.com/tiddlers/filters/max Operator.tid b/editions/tw5.com/tiddlers/filters/max Operator.tid index 837c456ce..5d92b44cf 100644 --- a/editions/tw5.com/tiddlers/filters/max Operator.tid +++ b/editions/tw5.com/tiddlers/filters/max Operator.tid @@ -1,11 +1,11 @@ caption: max created: 20190611130631390 -modified: 20190611131047026 +modified: 20230321133057297 op-input: a [[selection of titles|Title Selection]] op-output: the input as numbers, with any that are less than <<.place N>> being replaced by <<.place N>> op-parameter: a number op-parameter-name: N -op-purpose: treating each input title as a number, take the maximum of its value and the numeric value of the operand +op-purpose: treating each input title as a number, take the maximum of its value and the numeric value of the parameter tags: [[Filter Operators]] [[Mathematics Operators]] [[Binary Mathematics Operators]] title: max Operator type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/min Operator.tid b/editions/tw5.com/tiddlers/filters/min Operator.tid index 097cf376e..f9c569a3b 100644 --- a/editions/tw5.com/tiddlers/filters/min Operator.tid +++ b/editions/tw5.com/tiddlers/filters/min Operator.tid @@ -5,7 +5,7 @@ op-input: a [[selection of titles|Title Selection]] op-output: the input as numbers, with any that are greater than <<.place N>> being replaced by <<.place N>> op-parameter: a number op-parameter-name: N -op-purpose: treating each input title as a number, take the minimum of its value and the numeric value of the operand +op-purpose: treating each input title as a number, take the minimum of its value and the numeric value of the parameter tags: [[Filter Operators]] [[Mathematics Operators]] [[Binary Mathematics Operators]] title: min Operator type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/moduleproperty Operator.tid b/editions/tw5.com/tiddlers/filters/moduleproperty Operator.tid index 2ee4071d6..a62ddf4a5 100644 --- a/editions/tw5.com/tiddlers/filters/moduleproperty Operator.tid +++ b/editions/tw5.com/tiddlers/filters/moduleproperty Operator.tid @@ -2,7 +2,7 @@ caption: modulesproperty created: 20210919201126246 modified: 20210919201347702 op-input: a [[selection|Title Selection]] of modules -op-output: the value of the module property as specified in the operand +op-output: the value of the module property as specified in the parameter op-parameter: module property to retrieve op-purpose: retrieve a module property tags: [[Filter Operators]] [[Special Operators]] diff --git a/editions/tw5.com/tiddlers/filters/modules.tid b/editions/tw5.com/tiddlers/filters/modules.tid index fdc7f5cbe..3b42bc5d7 100644 --- a/editions/tw5.com/tiddlers/filters/modules.tid +++ b/editions/tw5.com/tiddlers/filters/modules.tid @@ -9,6 +9,6 @@ tags: [[Filter Operators]] [[Special Operators]] title: modules Operator type: text/vnd.tiddlywiki -<<.from-version "5.2.0">>The <<.op modules>> filter allows two optional operands. When both are specified, it returns the modules with the module property specified in the first operand which has the value in the second operand. +<<.from-version "5.2.0">>The <<.op modules>> filter allows two optional parameters. When both are specified, it returns the modules with the module property specified in the first parameter which has the value in the second parameter. <<.operator-examples "modules">> diff --git a/editions/tw5.com/tiddlers/filters/multiply Operator.tid b/editions/tw5.com/tiddlers/filters/multiply Operator.tid index 6eb92b7ad..bc91f9f27 100644 --- a/editions/tw5.com/tiddlers/filters/multiply Operator.tid +++ b/editions/tw5.com/tiddlers/filters/multiply Operator.tid @@ -5,7 +5,7 @@ op-input: a [[selection of titles|Title Selection]] op-output: the input as numbers, but with each one multiplied by <<.place N>> op-parameter: a number op-parameter-name: N -op-purpose: treating each input title as a number, multiply it by the numeric value of the operand +op-purpose: treating each input title as a number, multiply it by the numeric value of the parameter tags: [[Filter Operators]] [[Mathematics Operators]] [[Binary Mathematics Operators]] title: multiply Operator type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/power Operator.tid b/editions/tw5.com/tiddlers/filters/power Operator.tid index d4afb67ce..2611049dc 100644 --- a/editions/tw5.com/tiddlers/filters/power Operator.tid +++ b/editions/tw5.com/tiddlers/filters/power Operator.tid @@ -5,7 +5,7 @@ op-input: a [[selection of titles|Title Selection]] op-output: the input as numbers, but with each one raised to the power of <<.place N>> op-parameter: a number op-parameter-name: N -op-purpose: treating each input title as a number, raise it to the power of the numeric value of the operand +op-purpose: treating each input title as a number, raise it to the power of the numeric value of the parameter tags: [[Filter Operators]] [[Mathematics Operators]] [[Binary Mathematics Operators]] title: power Operator type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/prefix.tid b/editions/tw5.com/tiddlers/filters/prefix.tid index b96cdc599..6e2633f2d 100644 --- a/editions/tw5.com/tiddlers/filters/prefix.tid +++ b/editions/tw5.com/tiddlers/filters/prefix.tid @@ -1,27 +1,26 @@ +caption: prefix created: 20140410103123179 -modified: 20220218023400000 +modified: 20230711082821266 +op-input: a [[selection of titles|Title Selection]] +op-neg-output: those input tiddlers that do <<.em not>> start with <<.place S>> +op-output: those input titles that start with <<.place S>> +op-parameter: a string of characters +op-parameter-name: S +op-purpose: filter the input titles by how they start +op-suffix: the <<.op prefix>> operator uses a rich suffix, see below for details tags: [[Filter Operators]] [[String Operators]] [[Negatable Operators]] title: prefix Operator type: text/vnd.tiddlywiki -caption: prefix -op-purpose: filter the input titles by how they start -op-input: a [[selection of titles|Title Selection]] -op-parameter: a string of characters -op-parameter-name: S -op-output: those input titles that start with <<.place S>> -op-neg-output: those input tiddlers that do <<.em not>> start with <<.place S>> -op-suffix: the <<.op prefix>> operator uses a rich suffix, see below for details <<.from-version "5.2.2">> The <<.op prefix>> operator uses an extended syntax that permits multiple flags to be passed: ``` -[prefix:[]] +[prefix:[] ``` * ''flag list'': a comma delimited list of flags -* ''operand'': filter operand The available flags are: diff --git a/editions/tw5.com/tiddlers/filters/prepend.tid b/editions/tw5.com/tiddlers/filters/prepend.tid index 5f6cc102d..bd16c78d9 100644 --- a/editions/tw5.com/tiddlers/filters/prepend.tid +++ b/editions/tw5.com/tiddlers/filters/prepend.tid @@ -2,8 +2,8 @@ caption: prepend created: 20151017145439292 modified: 20151108051701587 op-input: a list of items -op-neg-output: a list with items prepended from the tail of the operand array -op-output: a list with items prepended from the head of the operand array +op-neg-output: a list with items prepended from the tail of the parameter array +op-output: a list with items prepended from the head of the parameter array op-parameter: the array of items to be prepended to the head of the list op-parameter-name: list op-purpose: prepend a range of items from an array to the list diff --git a/editions/tw5.com/tiddlers/filters/range.tid b/editions/tw5.com/tiddlers/filters/range.tid index 12813a5b9..48dfa2366 100644 --- a/editions/tw5.com/tiddlers/filters/range.tid +++ b/editions/tw5.com/tiddlers/filters/range.tid @@ -1,15 +1,15 @@ +caption: range created: 20171221184734665 -modified: 20210907170339891 +modified: 20230321133838310 +op-input: ignored +op-neg-output: a series of evenly spaced numbers ranging from `` to `` in reverse order +op-output: a series of evenly spaced numbers ranging from `` to `` +op-parameter: a range specification, like `[1],[5]` +op-parameter-name: N +op-purpose: generate a range of numbers tags: [[Filter Operators]] [[Negatable Operators]] [[Selection Constructors]] title: range Operator type: text/vnd.tiddlywiki -caption: range -op-purpose: generate a range of numbers -op-input: ignored -op-parameter: a range specification, like `[1],[5]` -op-parameter-name: N -op-output: a series of evenly spaced numbers ranging from `` to `` -op-neg-output: a series of evenly spaced numbers ranging from `` to `` in reverse order \define range_example(range) ``` @@ -21,7 +21,7 @@ op-neg-output: a series of evenly spaced numbers ranging from `` to `> The range operator has been updated to use multiple operands to specify its parameters. Prior to this version, the range operator only had one operand, with the three parts delimited by `,`, `;` or `:`. +<<.from-version "5.2.0">> The range operator has been updated to use multiple parameters. Prior to this version, the range operator only had one parameter, with the three parts delimited by `,`, `;` or `:`. ``` [range[]] @@ -29,7 +29,7 @@ The `range` operator produces a list of numbers counting up or down. It is usef [range[],[],[]] ``` -The behaviour depends on the number of operands: +The behaviour depends on the number of parameters: |Parameter |Output |h |`` |Whole numbers up to `` | @@ -47,7 +47,7 @@ Each part must be a number, and works as follows: ** Cannot be zero. ** We always count from `` toward ``, whether `` is positive or negative. -The number of decimal points in the output is fixed, and based on the operand with the //most// decimal points. +The number of decimal points in the output is fixed, and based on the parameter with the //most// decimal points. To prevent the browser from freezing, `range` is currently limited to 10,000 values. diff --git a/editions/tw5.com/tiddlers/filters/reduce.tid b/editions/tw5.com/tiddlers/filters/reduce.tid index 66b62a8b0..06c28825c 100644 --- a/editions/tw5.com/tiddlers/filters/reduce.tid +++ b/editions/tw5.com/tiddlers/filters/reduce.tid @@ -1,6 +1,6 @@ caption: reduce created: 20201004154131193 -modified: 20210522162536854 +modified: 20230321133918020 op-input: a [[selection of titles|Title Selection]] passed as input to the filter op-output: the final result of running the subfilter <<.place S>> op-parameter: a [[filter expression|Filter Expression]]. Optional second parameter for initial value for accumulator @@ -25,7 +25,7 @@ The following variables are available within the subfilter: If the <<.op reduce>> operator receives no input, its output will be empty. The [[else Operator]] can be useful in such cases. -<<.tip "Literal filter operands cannot contain square brackets but you can work around the issue by using a variable:">> +<<.tip "Literal filter parameters cannot contain square brackets but you can work around the issue by using a variable:">> ``` <$set name="sum-input" value="[add]"> diff --git a/editions/tw5.com/tiddlers/filters/remainder Operator.tid b/editions/tw5.com/tiddlers/filters/remainder Operator.tid index ede8b314c..40ca29b9a 100644 --- a/editions/tw5.com/tiddlers/filters/remainder Operator.tid +++ b/editions/tw5.com/tiddlers/filters/remainder Operator.tid @@ -5,7 +5,7 @@ op-input: a [[selection of titles|Title Selection]] op-output: the input as numbers, but with each replaced by the remainder when dividing it by <<.place N>> op-parameter: a number op-parameter-name: N -op-purpose: treating each input title as a number, return the remainder when divided by the numeric value of the operand +op-purpose: treating each input title as a number, return the remainder when divided by the numeric value of the parameter tags: [[Filter Operators]] [[Mathematics Operators]] [[Binary Mathematics Operators]] title: remainder Operator type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/remove.tid b/editions/tw5.com/tiddlers/filters/remove.tid index ed41c3db4..8c0b5afa3 100644 --- a/editions/tw5.com/tiddlers/filters/remove.tid +++ b/editions/tw5.com/tiddlers/filters/remove.tid @@ -2,12 +2,12 @@ caption: remove created: 20151017144531676 modified: 20170125200005000 op-input: a list of items -op-neg-output: items removed from current list that appear at the tail of the operand array -op-output: items removed from current list that appear at the head of the operand array +op-neg-output: items removed from current list that appear at the tail of the parameter array +op-output: items removed from current list that appear at the head of the parameter array op-parameter: an array of items to remove op-parameter-name: array op-prefix: causes N items from the end of the array to be removed -op-purpose: remove a list of titles specified in the operand from the input +op-purpose: remove a list of titles specified in the parameter from the input op-suffix: an integer N, defaulting to all tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]] title: remove Operator diff --git a/editions/tw5.com/tiddlers/filters/removeprefix.tid b/editions/tw5.com/tiddlers/filters/removeprefix.tid index 0b6156052..9fc2fd399 100644 --- a/editions/tw5.com/tiddlers/filters/removeprefix.tid +++ b/editions/tw5.com/tiddlers/filters/removeprefix.tid @@ -1,15 +1,15 @@ +caption: removeprefix created: 20140410103123179 -modified: 20220218023400000 +modified: 20230711082842515 +op-input: a [[selection of titles|Title Selection]] +op-output: those input titles that start with <<.place S>>, but with those characters discarded +op-parameter: a string of characters +op-parameter-name: S +op-purpose: filter the input titles by how they start, deleting that prefix +op-suffix: the <<.op removeprefix>> operator uses a rich suffix, see below for details tags: [[Filter Operators]] [[String Operators]] title: removeprefix Operator type: text/vnd.tiddlywiki -caption: removeprefix -op-purpose: filter the input titles by how they start, deleting that prefix -op-input: a [[selection of titles|Title Selection]] -op-parameter: a string of characters -op-parameter-name: S -op-output: those input titles that start with <<.place S>>, but with those characters discarded -op-suffix: the <<.op removeprefix>> operator uses a rich suffix, see below for details <<.tip " This filters out input titles that do not start with S. For removing S without filtering out input titles that don't start with S, see [[trim|trim Operator]].">> @@ -18,11 +18,10 @@ op-suffix: the <<.op removeprefix>> operator uses a rich suffix, see below for d The <<.op removeprefix>> operator uses an extended syntax that permits multiple flags to be passed: ``` -[removeprefix:[]] +[removeprefix:[]] ``` * ''flag list'': a comma delimited list of flags -* ''operand'': filter operand The available flags are: diff --git a/editions/tw5.com/tiddlers/filters/removesuffix.tid b/editions/tw5.com/tiddlers/filters/removesuffix.tid index 4a1812ae0..bde911d06 100644 --- a/editions/tw5.com/tiddlers/filters/removesuffix.tid +++ b/editions/tw5.com/tiddlers/filters/removesuffix.tid @@ -1,15 +1,15 @@ +caption: removesuffix created: 20140828133830424 -modified: 20220218023400000 +modified: 20230711082859816 +op-input: a [[selection of titles|Title Selection]] +op-output: those input titles that end with <<.place S>>, but with those characters discarded +op-parameter: a string of characters +op-parameter-name: S +op-purpose: filter the input titles by how they end, deleting that suffix +op-suffix: the <<.op removesuffix>> operator uses a rich suffix, see below for details tags: [[Filter Operators]] [[String Operators]] title: removesuffix Operator type: text/vnd.tiddlywiki -caption: removesuffix -op-purpose: filter the input titles by how they end, deleting that suffix -op-input: a [[selection of titles|Title Selection]] -op-parameter: a string of characters -op-parameter-name: S -op-output: those input titles that end with <<.place S>>, but with those characters discarded -op-suffix: the <<.op removesuffix>> operator uses a rich suffix, see below for details <<.tip " This filters out input titles that do not end with S. For removing S without filtering out input titles that don't end with S, see [[trim|trim Operator]].">> @@ -18,11 +18,10 @@ op-suffix: the <<.op removesuffix>> operator uses a rich suffix, see below for d The <<.op removesuffix>> operator uses an extended syntax that permits multiple flags to be passed: ``` -[removesuffix:[]] +[removesuffix:[]] ``` * ''flag list'': a comma delimited list of flags -* ''operand'': filter operand The available flags are: diff --git a/editions/tw5.com/tiddlers/filters/search.tid b/editions/tw5.com/tiddlers/filters/search.tid index 6a6438b9f..79d323a93 100644 --- a/editions/tw5.com/tiddlers/filters/search.tid +++ b/editions/tw5.com/tiddlers/filters/search.tid @@ -1,6 +1,6 @@ caption: search created: 20140410103123179 -modified: 20211129120739275 +modified: 20230711084359603 op-input: a [[selection of titles|Title Selection]] op-neg-output: those input tiddlers in which <<.em not>> all of the search terms can be found op-output: those input tiddlers in which <<.em all>> of the search terms can be found in the value of field <<.place F>> @@ -16,7 +16,7 @@ type: text/vnd.tiddlywiki The <<.op search>> operator uses an extended syntax that permits multiple fields and flags to be passed: ``` -[search::[]] +[search::[]] ``` * ''field list'': a comma delimited list of field names to restrict the search @@ -24,7 +24,7 @@ The <<.op search>> operator uses an extended syntax that permits multiple fields ** an asterisk `*` instead of the field list causes the search to be performed across all fields available on each tiddler ** preceding the list with a minus sign `-` reverses the order so that the search is performed on all fields except the listed fields * ''flag list'': a comma delimited list of flags (defaults to `words` if blank) -* ''operand'': filter operand +* ''parameter'': filter parameter This example searches the fields <<.field title>> and <<.field caption>> for a case-sensitive match for the literal string <<.op-word "The first">>: diff --git a/editions/tw5.com/tiddlers/filters/sortby.tid b/editions/tw5.com/tiddlers/filters/sortby.tid index d6555ae4d..773c6a598 100644 --- a/editions/tw5.com/tiddlers/filters/sortby.tid +++ b/editions/tw5.com/tiddlers/filters/sortby.tid @@ -5,7 +5,7 @@ op-input: a list of items op-output: all items sorted by lookup list op-parameter: a list specifying the order in which to sort the current list op-parameter-name: order -op-purpose: sort the current list in the order of the list referenced in the operand +op-purpose: sort the current list in the order of the list referenced in the parameter tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]] title: sortby Operator type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/subfilter Operator.tid b/editions/tw5.com/tiddlers/filters/subfilter Operator.tid index aaf7b731c..096560ae2 100644 --- a/editions/tw5.com/tiddlers/filters/subfilter Operator.tid +++ b/editions/tw5.com/tiddlers/filters/subfilter Operator.tid @@ -7,14 +7,14 @@ op-neg-output: those input titles that are <<.em not>> returned from the subfilt op-output: the [[selection of titles|Title Selection]] returned from the subfilter <<.place S>> op-parameter: a [[filter expression|Filter Expression]] op-parameter-name: S -op-purpose: select titles from the operand interpreted as a [[filter expression|Filter Expression]] +op-purpose: select titles from the parameter interpreted as a [[filter expression|Filter Expression]] tags: [[Filter Operators]] [[Field Operators]] [[Selection Constructors]] [[Negatable Operators]] [[Selection Constructors: Conditional]] title: subfilter Operator type: text/vnd.tiddlywiki <<.from-version "5.1.18">> Note that the <<.op subfilter>> operator was introduced in version 5.1.18 and is not available in earlier versions. -<<.tip " Literal filter operands cannot contain square brackets but you can work around the issue by using a variable:">> +<<.tip " Literal filter parameters cannot contain square brackets but you can work around the issue by using a variable:">> ``` <$set name="myFilter" value="[tag[one]]"> @@ -24,6 +24,6 @@ type: text/vnd.tiddlywiki <<.tip "Compare with the similar [[filter|filter Operator]] operator which runs a subfilter against each title, returning those titles that return a non-empty list (and discards the results of the subfilter)">> -The <<.op subfilter>> operator will act as a [[constructor|Selection Constructors]] whenever the filter defined by its operand is a [[constructor|Selection Constructors]]. Otherwise, it will act as a [[modifier|Selection Constructors]]. +The <<.op subfilter>> operator will act as a [[constructor|Selection Constructors]] whenever the filter defined by its parameter is a [[constructor|Selection Constructors]]. Otherwise, it will act as a [[modifier|Selection Constructors]]. <<.operator-examples "subfilter">> diff --git a/editions/tw5.com/tiddlers/filters/subtract Operator.tid b/editions/tw5.com/tiddlers/filters/subtract Operator.tid index c386b90ff..30bd28fa2 100644 --- a/editions/tw5.com/tiddlers/filters/subtract Operator.tid +++ b/editions/tw5.com/tiddlers/filters/subtract Operator.tid @@ -5,7 +5,7 @@ op-input: a [[selection of titles|Title Selection]] op-output: the input as numbers, but with <<.place N>> subtracted from each one op-parameter: a number op-parameter-name: N -op-purpose: treating each input title as a number, subtract from each the numeric value of the operand +op-purpose: treating each input title as a number, subtract from each the numeric value of the parameter tags: [[Filter Operators]] [[Mathematics Operators]] [[Binary Mathematics Operators]] title: subtract Operator type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/suffix.tid b/editions/tw5.com/tiddlers/filters/suffix.tid index 1c1a7bb9b..a7ff4eabb 100644 --- a/editions/tw5.com/tiddlers/filters/suffix.tid +++ b/editions/tw5.com/tiddlers/filters/suffix.tid @@ -1,27 +1,26 @@ +caption: suffix created: 20140828133830424 -modified: 20220218023400000 +modified: 20230711083049169 +op-input: a [[selection of titles|Title Selection]] +op-neg-output: those input tiddlers that do <<.em not>> end with <<.place S>> +op-output: those input titles that end with <<.place S>> +op-parameter: a string of characters +op-parameter-name: S +op-purpose: filter the input titles by how they end +op-suffix: the <<.op suffix>> operator uses a rich suffix, see below for details tags: [[Filter Operators]] [[String Operators]] [[Negatable Operators]] title: suffix Operator type: text/vnd.tiddlywiki -caption: suffix -op-purpose: filter the input titles by how they end -op-input: a [[selection of titles|Title Selection]] -op-parameter: a string of characters -op-parameter-name: S -op-output: those input titles that end with <<.place S>> -op-neg-output: those input tiddlers that do <<.em not>> end with <<.place S>> -op-suffix: the <<.op suffix>> operator uses a rich suffix, see below for details <<.from-version "5.2.2">> The <<.op suffix>> operator uses an extended syntax that permits multiple flags to be passed: ``` -[suffix:[]] +[suffix:[]] ``` * ''flag list'': a comma delimited list of flags -* ''operand'': filter operand The available flags are: diff --git a/editions/tw5.com/tiddlers/filters/syntax/All Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/All Filter Run Prefix.tid new file mode 100644 index 000000000..b1f123f82 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/All Filter Run Prefix.tid @@ -0,0 +1,18 @@ +created: 20230316150731234 +from-version: 5.1.23 +modified: 20230711084644541 +rp-input: all titles from previous filter runs +rp-output: output titles are appended to the output of previous filter runs without de-duplication. +rp-purpose: union of sets without de-duplication +tags: [[Named Filter Run Prefix]] +title: All Filter Run Prefix +type: text/vnd.tiddlywiki + +<$railroad text=""" +\start none +\end none +( ":all" | - ) +[[run|"Filter Run"]] +"""/> + +This prefix has an optional [[shortcut syntax|Shortcut Filter Run Prefix]] symbol `=run` \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid new file mode 100644 index 000000000..ee76ed636 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/And Filter Run Prefix.tid @@ -0,0 +1,18 @@ +created: 20230318142752854 +from-version: 5.1.23 +modified: 20230711084712170 +op-purpose: accumulation of filter steps +rp-input: the filter output of all previous runs so far +rp-output: output titles replace the output of previous filter runs +tags: [[Named Filter Run Prefix]] +title: And Filter Run Prefix +type: text/vnd.tiddlywiki + +<$railroad text=""" +\start none +\end none +( ":and" | - ) +[[run|"Filter Run"]] +"""/> + +This prefix has an optional [[shortcut syntax|Shortcut Filter Run Prefix]] symbol `+run` \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix (Examples).tid b/editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix (Examples).tid index d64ef3a5e..ef8ca679c 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix (Examples).tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix (Examples).tid @@ -2,8 +2,8 @@ created: 20211130114857532 filter1: [prefix[ca]then[ca]] filter2: [suffix[at]then[at]] filter3: other -modified: 20211204010918504 -tags: [[Filter Run Prefix Examples]] [[Filter Syntax]] [[Cascade Filter Run Prefix]] +modified: 20230305125250563 +tags: [[Cascade Filter Run Prefix]] title: Cascade Filter Run Prefix (Examples) type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix.tid index 3e6f48cb0..72d66c463 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix.tid @@ -1,20 +1,25 @@ created: 20211130114043280 -modified: 20211130121544118 -tags: [[Filter Syntax]] [[Filter Run Prefix]] +from-version: 5.2.1 +modified: 20230710073343947 +rp-input: the filter output of all previous runs so far +rp-output: the input titles as modified by the filters returned by this filter run +rp-purpose: modify input titles by successively evaluating a list of filters and applying the first result +tags: [[Named Filter Run Prefix]] title: Cascade Filter Run Prefix type: text/vnd.tiddlywiki -<<.from-version "5.2.1">> - -|''purpose'' |modify input titles by evaluating in turn a list of filters - as returned by the filter expression for this run - for each input title. | -|''input'' |all titles from previous filter runs | -|''output''|the input titles as modified by the filters returned by this filter run | +<$railroad text=""" +\start none +\end none +( ":cascade" | - ) +[[run|"Filter Run"]] +"""/> The [[filter expression|Filter Expression]] for this [[filter run|Filter Run]] is evaluated to return a list of filters. Each input title is then evaluated against each of the filters in turn, and the input title is replaced with the first result of the first filter that returns a non-empty list. If none of the filters return a result for an input title, it is replaced with an empty string. The following variables are available within the filter run: * <<.var currentTiddler>> - the input title -* <<.var ..currentTiddler>> - the value of the variable `currentTiddler` outside the filter run. +* <<.var ..currentTiddler>> - the value of the variable <<.var currentTiddler>> outside the filter run. -[[Examples|Cascade Filter Run Prefix (Examples)]] +[[Cascade Filter Run Prefix (Examples)]] diff --git a/editions/tw5.com/tiddlers/filters/syntax/Else Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/Else Filter Run Prefix.tid new file mode 100644 index 000000000..dee5fc7be --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/Else Filter Run Prefix.tid @@ -0,0 +1,18 @@ +created: 20230318142408662 +from-version: 5.1.23 +modified: 20230322140756821 +rp-input: all titles from previous filter runs +rp-output: if the filter output so far is an empty list then the output titles of the run are [[dominantly appended|Dominant Append]] to the filter's output.
if the filter output so far is not an empty list then the run is ignored. +rp-purpose: the filter run is only evaluated if the filter output of all previous runs so far is an empty list +tags: [[Named Filter Run Prefix]] +title: Else Filter Run Prefix +type: text/vnd.tiddlywiki + +<$railroad text=""" +\start none +\end none +( ":else" | - ) +[[run|"Filter Run"]] +"""/> + +This prefix has a [[Shortcut Filter Run Prefix]] symbol `~run` \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/filters/syntax/Except Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/Except Filter Run Prefix.tid new file mode 100644 index 000000000..aa28c7f8f --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/Except Filter Run Prefix.tid @@ -0,0 +1,18 @@ +created: 20230318142056008 +from-version: 5.1.23 +modified: 20230322140643066 +rp-input: all titles from previous filter runs +rp-output: output titles are removed from the filter's output (if such tiddlers exist) +rp-purpose: if output titles of this filter run are contained in the output of previous filter runs, they are removed, and otherwise ignored +tags: [[Named Filter Run Prefix]] +title: Except Filter Run Prefix +type: text/vnd.tiddlywiki + +<$railroad text=""" +\start none +\end none +( ":except" | - ) +[[run|"Filter Run"]] +"""/> + +This prefix has a [[Shortcut Filter Run Prefix]] symbol `-run` \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/filters/syntax/Filter Expression.tid b/editions/tw5.com/tiddlers/filters/syntax/Filter Expression.tid index 8521859ac..739be62bf 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Filter Expression.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Filter Expression.tid @@ -1,73 +1,21 @@ created: 20150124182421000 -modified: 20211129014550442 +modified: 20230710074507466 tags: [[Filter Syntax]] title: Filter Expression type: text/vnd.tiddlywiki +A <<.def "filter expression">> is the outermost level of the [[filter syntax|Filter Syntax]]. It consists of [[filter runs|Filter Run]] with optional [[filter run prefixes|Filter Run Prefix]]. Multiple filter runs are separated by [[whitespace|Filter Whitespace]]. + <$railroad text=""" -[{: - [: [[whitespace|"Filter Whitespace"]] ] - ("+"|"~"|:-|"-"|"="|":"[[named-prefix|"Named Filter Run Prefix"]]) +{ ( + - | + : [[<"prefix">|"Filter Run Prefix"]] + ) [[run|"Filter Run"]] -}] + + [[whitespace|"Filter Whitespace"]] +} """/> -A <<.def "filter expression">> is the outermost level of the [[filter syntax|Filter Syntax]]. It consists of one or more [[runs|Filter Run]]. +<<.tip """If the diagram has a single start and end line, as shown above, it means there is more info in the linked level above. The breadcrumbs can be used to navigate""">> -If a run has: - -* no prefix, its output titles are [[dominantly appended|Dominant Append]] to the filter's output -* the prefix `=`, output titles are appended to the filter's output without de-duplication. <<.from-version "5.1.20">> -* the prefix `-`, output titles are <<.em removed>> from the filter's output (if such tiddlers exist) -* the prefix `+`, it receives the filter output so far as its input; its output then <<.em "replaces">> all filter output so far and forms the input for the next run -* the prefix `~`, if the filter output so far is an empty list then the output titles of the run are [[dominantly appended|Dominant Append]] to the filter's output. If the filter output so far is not an empty list then the run is ignored. <<.from-version "5.1.18">> -* named prefixes for filter runs are available. <<.from-version "5.1.23">> -* named prefix `:filter`, it receives the filter output so far as its input. The next run is evaluated for each title of the input, removing every input title for which the output is an empty list. <<.from-version "5.1.23">> -** See [[Filter Filter Run Prefix]]. -* named prefix `:intersection` replaces all filter output so far with titles that are present in the output of this run, as well as the output from previous runs. Forms the input for the next run. <<.from-version "5.1.23">> -** See [[Intersection Filter Run Prefix]]. -* named prefix `:reduce` replaces all filter output so far with a single item by repeatedly applying a formula to each input title. A typical use is to add up the values in a given field of each input title. <<.from-version "5.1.23">> -** See [[Reduce Filter Run Prefix]]. -* named prefix `:sort` sorts all filter output so far by applying this run to each input title and sorting according to that output. <<.from-version "5.2.0">> -** See [[Sort Filter Run Prefix]]. -* named prefix `:map` transforms all filter output so far by applying this run to each input title and replacing the input title with the output of this run for that title. -** See [[Map Filter Run Prefix]]. <<.from-version "5.2.0">> - - -<<.tip "Compare named filter run prefix `:filter` with [[filter Operator]] which applies a subfilter to every input title, removing the titles that return an empty result from the subfilter">> - -<<.tip "Compare named filter run prefix `:reduce` with [[reduce Operator]] which is used to used to flatten a list of items down to a single item by repeatedly applying a subfilter.">> - -<<.tip """Within the filter runs prefixed with `:reduce`, `:sort`, `:map` and `:filter`, the "currentTiddler" variable is set to the title of the tiddler being processed. The value of currentTiddler outside the subfilter is available in the variable "..currentTiddler".<<.from-version "5.2.0">>""" >> - -In technical / logical terms: - -|!Run |!Equivalent named prefix |!Interpretation |!Output | -|`run` |`:or[run]` |de-duplicated union of sets |... OR run | -|`=run` |`:all[run]` |union of sets without de-duplication |... OR run | -|`+run` |`:and[run]` |accumulation of filter steps |... AND run | -|`-run` |`:except[run]` |difference of sets |... AND NOT run | -|`~run` |`:else[run]` |else |... ELSE run | -||`:intersection`|intersection of sets|| - -For the difference between `+` and `:intersection`, see [[Intersection Filter Run Prefix (Examples)]]. - -The input of a run is normally a list of all the non-[[shadow|ShadowTiddlers]] tiddler titles in the wiki (in no particular order). But the `+` prefix can change this: - -|Prefix|Input|h -|`-`, `~`, `=`, `:intersection` or none| <$link to="all Operator">`[all[]]` tiddler titles, unless otherwise determined by the first [[filter operator|Filter Operators]]| -|`+`, `:filter`, `:reduce`,`:sort`|the filter output of all previous runs so far| - -Precisely because of varying inputs, be aware that both prefixes `-` and `+` do not behave inverse to one another! - -For example, in both of the following, `$:/baz` will only be removed if it actually exists: - -* <$link to="is Operator"> `foo bar $:/baz -[is[system]]` -* <$link to="prefix Operator">`foo bar $:/baz -[prefix[$:/]]` - -To understand why, consider the input for both final runs with their `-` prefix. - -In order to remove `$:/baz` in any case, existing or not, simply use the `+` prefix with [[negated filter operators|Filter Operators]]: - -* <$link to="is Operator">`foo bar $:/baz +[!is[system]]` -* <$link to="prefix Operator">`foo bar $:/baz +[!prefix[$:/]]` +<<.tip """If the diagram has no start and no end, as used in lower levels, it means that higher level syntax elements have been removed, to increase readability and simplicity. The breadcrumbs can be used to navigate""">> diff --git a/editions/tw5.com/tiddlers/filters/syntax/Filter Filter Run Prefix (Examples).tid b/editions/tw5.com/tiddlers/filters/syntax/Filter Filter Run Prefix (Examples).tid index dd1e98e63..2e3272ff9 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Filter Filter Run Prefix (Examples).tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Filter Filter Run Prefix (Examples).tid @@ -1,6 +1,6 @@ created: 20211129022707404 -modified: 20211204154839890 -tags: [[Filter Syntax]] [[Filter Run Prefix Examples]] [[Filter Filter Run Prefix]] +modified: 20230305125338118 +tags: [[Filter Filter Run Prefix]] title: Filter Filter Run Prefix (Examples) type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/syntax/Filter Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/Filter Filter Run Prefix.tid index f8eb66847..88eaedc42 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Filter Filter Run Prefix.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Filter Filter Run Prefix.tid @@ -1,27 +1,32 @@ created: 20211129022455873 -modified: 20211129022550425 -tags: [[Filter Syntax]] [[Filter Run Prefix]] +from-version: 5.1.23 +modified: 20230710073334078 +rp-input: the filter output of all previous runs so far +rp-output: the input titles for which the filter run is not empty +rp-purpose: remove every input title for which the filter run output is an empty list +tags: [[Named Filter Run Prefix]] title: Filter Filter Run Prefix type: text/vnd.tiddlywiki -<<.from-version "5.1.23">> - -|''purpose'' |remove every input title for which the filter run output is an empty list | -|''input'' |all titles from previous filter runs | -|''output''|the input titles for which the filter run is not empty | +<$railroad text=""" +\start none +\end none +( ":filter" | - ) +[[run|"Filter Run"]] +"""/> It receives the filter output so far as its input. The next run is evaluated for each title of the input, removing every input title for which the output is an empty list. -Note that within the filter run, the "currentTiddler" variable is set to the title of the tiddler being processed. This permits filter runs like `:filter[{!!price}multiply{!!cost}compare:integer:gteq[5]]` to be used for computation. The value of currentTiddler outside the run is available in the variable "..currentTiddler". +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 `:filter[{!!price}multiply{!!cost}compare:integer:gteq[5]]` to be used for computation. The value of currentTiddler outside the run is available in the variable <<.var ..currentTiddler>>. The following variables are available within the filter run: -* ''currentTiddler'' - the input title -* ''..currentTiddler'' - the value of the variable `currentTiddler` outside the filter run. -* ''index'' - <<.from-version "5.2.1">> the numeric index of the current list item (with zero being the first item in the list). -* ''revIndex'' - <<.from-version "5.2.1">> the reverse numeric index of the current list item (with zero being the last item in the list). -* ''length'' - <<.from-version "5.2.1">> the total length of the input list. +* <<.var currentTiddler>> - the input title +* <<.var ..currentTiddler>> - the value of the variable `currentTiddler` outside the filter run. +* <<.var index>> - <<.from-version "5.2.1">> the numeric index of the current list item (with zero being the first item in the list). +* <<.var revIndex>> - <<.from-version "5.2.1">> the reverse numeric index of the current list item (with zero being the last item in the list). +* <<.var length>> - <<.from-version "5.2.1">> the total length of the input list. <<.tip "Compare named filter run prefix `:filter` with [[filter Operator]] which applies a subfilter to every input title, removing the titles that return an empty result from the subfilter">> -[[Examples|Filter Filter Run Prefix (Examples)]] +[[Filter Filter Run Prefix (Examples)]] diff --git a/editions/tw5.com/tiddlers/filters/syntax/Filter Parameter.tid b/editions/tw5.com/tiddlers/filters/syntax/Filter Parameter.tid index d394f1900..9334fd069 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Filter Parameter.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Filter Parameter.tid @@ -1,15 +1,17 @@ created: 20150220152540000 -modified: 20210629215024053 -tags: [[Filter Syntax]] +modified: 20230710074423650 +tags: [[Filter Step]] title: Filter Parameter type: text/vnd.tiddlywiki <$railroad text=""" -( "[" [:{/"anything but ]"/}] "]" +\start none +\end none +( "[" [: <-"hard"-> /"anything but ]"/] "]" | - "{" [:{/"anything but }"/}] "}" + "{" [: <-"indirect"-> /"anything but }"/] "}" | - "<" [:{/"anything but >"/}] ">" + "<" [: <-"variable"-> /"anything but >"/] ">" ) """/> @@ -24,9 +26,11 @@ The parameter to a [[filter operator|Filter Operators]] can be: :: The parameter is the text indicated by the [[text reference|TextReference]] whose name appears between the curly brackets, i.e. a [[field|TiddlerFields]] of a specified tiddler, or the value of a property of a specified [[data tiddler|DataTiddlers]]. : <<.def variable>> :: `` -:: The parameter is the current value of the [[variable|Variables]] whose name appears between the angle brackets. Macro parameters are <<.em not>> supported up to and including ~TiddlyWiki v5.1.23. +:: The parameter is the current value of the [[variable|Variables]] whose name appears between the angle brackets. Macro parameters are <<.em not>> supported up to v5.2.0 ::<<.from-version "5.2.0">> Literal macro parameters are supported. For example: `[]`. -<<.from-version "5.1.23">> Filter operators support multiple parameters which are separated by a ` , ` character. +--- + +<<.from-version "5.1.23">> [[Filter Step]]s support multiple parameters which are separated by a `,` character. For example: `[param1],[param2]` or `,{param2}` diff --git a/editions/tw5.com/tiddlers/filters/syntax/Filter Run Prefix (Examples).tid b/editions/tw5.com/tiddlers/filters/syntax/Filter Run Prefix (Examples).tid index dc39c948d..ddbb94c5c 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Filter Run Prefix (Examples).tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Filter Run Prefix (Examples).tid @@ -1,6 +1,6 @@ created: 20201117073343969 -modified: 20211129032537195 -tags: [[Filter Syntax]] [[Filter Run Prefix Examples]] +modified: 20230315152812472 +tags: title: Filter Run Prefix (Examples) type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/syntax/Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/Filter Run Prefix.tid new file mode 100644 index 000000000..4387ba9cb --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/Filter Run Prefix.tid @@ -0,0 +1,18 @@ +created: 20230305130600148 +modified: 20230711090913687 +tags: [[Filter Expression]] +title: Filter Run Prefix +type: text/vnd.tiddlywiki + +There are 2 types of filter run prefixes that are interchangeable. Named prefixes and shortcut prefixes. + +<$railroad text=""" +\start none +\end none +( + - | +: [[<":named prefix"> /"starting with v5.1.23"/ |"Named Filter Run Prefix"]] | + [[<"shortcut prefix"> /"prior to v5.1.23"/ |"Shortcut Filter Run Prefix"]] +) +[[run|"Filter Run"]] +"""/> diff --git a/editions/tw5.com/tiddlers/filters/syntax/Filter Run.tid b/editions/tw5.com/tiddlers/filters/syntax/Filter Run.tid index e3843b492..c5e9c8a34 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Filter Run.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Filter Run.tid @@ -1,11 +1,13 @@ created: 20150124182117000 -modified: 20150129133716000 -tags: [[Filter Syntax]] +modified: 20230710074357002 +tags: [[Filter Expression]] title: Filter Run type: text/vnd.tiddlywiki <$railroad text=""" -( "[" { [[step|"Filter Step"]] } "]" +\start none +\end none +( "[" { [[<"Filter Step">|"Filter Step"]] } "]" | [:{/"anything but [ ] or whitespace"/}] | @@ -19,7 +21,6 @@ A <<.def run>> consists of [[steps|Filter Step]], and it outputs a [[selection|T The steps are processed from left to right. The input to the first step is same as the input to the run. For each subsequent step, the input is the output of the previous step. -{{Selection Constructors}} The lower three options in the diagram match syntax like `HelloThere`, `"HelloThere"`, `'HelloThere'` and `"Filter Operators"`. They are short for `[title[...]]`. diff --git a/editions/tw5.com/tiddlers/filters/syntax/Filter Step.tid b/editions/tw5.com/tiddlers/filters/syntax/Filter Step.tid index b569ec4d6..73b58524a 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Filter Step.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Filter Step.tid @@ -1,23 +1,35 @@ created: 20150124182127000 -modified: 20201103111044922 -tags: [[Filter Syntax]] +modified: 20230710074414361 +tags: [[Filter Run]] title: Filter Step type: text/vnd.tiddlywiki +A <<.def "filter step">> represents a single operation within a <<.def "filter run">>. + +In programming terms, it is akin to a function call to which the step's input is passed as a parameter. A step's output is a [[title selection|Title Selection]] that contributes to a [[filter run|Filter Run]] and hence to the entire [[filter expression|Filter Expression]] that contains it. + <$railroad text=""" +\start none +\end none [:"!"] -[: [[operator|"Filter Operators"]] [:":" suffix] ] -[[parameter|"Filter Parameter"]] +( / "if omitted, defaults to: title" /|: +( - | :[[operator|"Filter Operators"]] ) +{ [:":" [[suffix|"Filter Operators"]] ] } ) +{ [[parameter|"Filter Parameter"]] + "," } """/> -A <<.def step>> represents a single operation within a [[filter|Filter Syntax]]. +The step's <<.def operator>> is drawn from a list of predefined keywoards which are known as [[filter operators|Filter Operators]]. -In programming terms, it is akin to a function call to which [[the step's input|Filter Run]] is passed as an implicit parameter. A step's output is a [[selection|Title Selection]] that contributes to a [[run|Filter Run]] and hence to the entire [[filter expression|Filter Expression]] that contains it. - -The step's <<.def operator>> is drawn from a list of [[predefined keywords|Filter Operators]], which can be extended by plugins. Any unrecognised operator is treated as if it was the suffix to the <<.olink field>> operator. If a step's operator is omitted altogether, it defaults to `title`. +Many steps require an explicit <<.def parameter>>, that further defines what the step is to do. The <<.def suffix>> is additional text, often the name of a [[field|TiddlerFields]], that extends the meaning of certain operators. -Many steps require an explicit <<.def parameter>> value, also known as an <<.def operand>>, that further defines what the step is to do. +If a step's <<.def operator>> and <<.def suffix>> are //omitted// altogether, it defaults to the [[title|title Operator]] operator. -<<.from-version "5.1.23">> Some steps accept multiple parameters which are separated by a ` , ` character. +<<.from-version "5.1.23">> Some steps accept multiple <<.def parameter>>s which are separated by a `,` character. + +Any unrecognised operator is treated as if it was the suffix to the <<.olink field>> operator. + +Filter operators can be extended by plugins. + +{{Selection Constructors}} diff --git a/editions/tw5.com/tiddlers/filters/syntax/Filter Syntax.tid b/editions/tw5.com/tiddlers/filters/syntax/Filter Syntax.tid index 0190aabab..58a03aa20 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Filter Syntax.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Filter Syntax.tid @@ -1,18 +1,24 @@ created: 20140210141217955 -modified: 20150124184229000 +list: [[Filter Expression]] [[Filter Run]] [[Filter Step]] [[Filter Parameter]] [[Filter Whitespace]] +modified: 20230710074340943 tags: Filters title: Filter Syntax type: text/vnd.tiddlywiki -list: [[Filter Expression]] [[Filter Run]] [[Filter Step]] [[Filter Parameter]] [[Filter Whitespace]] <<.preamble """[[Filters]] follow a grammar that is presented here, using [[railroad diagrams|Railroad Diagrams]], for those who find formal syntax descriptions helpful. However, you can [[learn to write filters|Introduction to filter notation]] without needing to understand this group of tiddlers.""">> -A <<.def filter>> is a pipeline for transforming an <<.def input>> into an <<.def output>>. Both the input and the output are [[ordered sets of titles|Title Selection]] of things like tiddlers and fields. +A <<.def filter>> is a pipeline for transforming an <<.def input>> into an <<.def output>>. Both the input and the output are [[ordered sets of titles|Title Selection]] of tiddlers and fields. -Filters are [[expressions|Filter Expression]] constructed from smaller building blocks, called [[runs|Filter Run]] and [[steps|Filter Step]], each of which also transforms an input to an output. +Filters are ''expressions'' constructed from smaller building blocks, called ''runs'', which are built using ''steps''. Eeach of which also transforms an input to an output. A filter starts with an empty output. Its runs are processed from left to right, progressively modifying the output. -Here are details of the various building blocks involved: +The "Filter Syntax" description starts with: -<> +<$railroad text=""" +\start double +\end double +[[<"Filter Expression">|"Filter Expression"]] +"""/> + +<<.tip "The railroad boxes as the one above can be used to navigate">> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/filters/syntax/Filter Whitespace.tid b/editions/tw5.com/tiddlers/filters/syntax/Filter Whitespace.tid index f31422b3d..f33092e9c 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Filter Whitespace.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Filter Whitespace.tid @@ -1,11 +1,13 @@ created: 20150124182304000 -modified: 20150125105243000 -tags: [[Filter Syntax]] +modified: 20230710074447240 +tags: [[Filter Expression]] title: Filter Whitespace type: text/vnd.tiddlywiki <$railroad text=""" +\start none +\end none {( "space" | "tab" | "linefeed" | "return" | "vertical tab" | "formfeed" )} """/> -Whitespace characters can appear between each [[run|Filter Run]] of a [[filter expression|Filter Expression]]. +Whitespace characters can appear between each run of a [[filter expression|Filter Expression]]. diff --git a/editions/tw5.com/tiddlers/filters/syntax/Interchangeable Filter Run Prefixes.tid b/editions/tw5.com/tiddlers/filters/syntax/Interchangeable Filter Run Prefixes.tid new file mode 100644 index 000000000..0313f543a --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/Interchangeable Filter Run Prefixes.tid @@ -0,0 +1,44 @@ +created: 20230316151518640 +modified: 20230327130626715 +tags: [[Filter Run Prefix]] +title: Interchangeable Filter Run Prefixes +type: text/vnd.tiddlywiki + +!! Interchangeable Filter Run Prefixes + +In technical / logical terms: + +|!Run |!Equivalent named prefix |!Interpretation |!Output | +|`[run]` |`:or[run]` |de-duplicated union of sets |... OR run | +|`+[run]` |`:and[run]` |accumulation of filter steps |... AND run | +|`-[run]` |`:except[run]` |difference of sets |... AND NOT run | +|`~[run]` |`:else[run]` |else |... ELSE run | +|`=[run]` |`:all[run]` |union of sets without de-duplication |... OR run | + +The input of a run is normally a list of all the non-[[shadow|ShadowTiddlers]] tiddler titles in the wiki (in no particular order).
But the `+` prefix can change this: + +|Prefix|Input|h +|`-`, `~`, `=`, `:intersection` or none| <$link to="all Operator">`[all[]]` tiddler titles, unless otherwise determined by the first [[filter operator|Filter Operators]]| +|`+`, `:filter`, `:map`, `:reduce`,`:sort` |the filter output of all previous runs so far| + +Precisely because of varying inputs, be aware that both prefixes `-` and `+` do not behave inverse to one another! + +For example, in both of the following, `$:/baz` will only be removed if it actually exists: + +* <$link to="is Operator"> `foo bar $:/baz -[is[system]]` +* <$link to="prefix Operator">`foo bar $:/baz -[prefix[$:/]]` + +To understand why, consider the input for both final runs with their `-` prefix. + +In order to remove `$:/baz` in any case, existing or not, simply use the `+` prefix with [[negated filter operators|Filter Operators]]: + +* <$link to="is Operator">`foo bar $:/baz +[!is[system]]` +* <$link to="prefix Operator">`foo bar $:/baz +[!prefix[$:/]]` + +!! Difference between + and intersection + +For the difference between `+` and `:intersection`, see [[Intersection Filter Run Prefix (Examples)]]. + +!! For Developers + +To create a new filter run prefix, create a [[Javascript module|Modules]] with a [[module-type|ModuleType]] of `filterrunprefix`. diff --git a/editions/tw5.com/tiddlers/filters/syntax/Intersection Filter Run Prefix (Examples).tid b/editions/tw5.com/tiddlers/filters/syntax/Intersection Filter Run Prefix (Examples).tid index d074eb247..fa9bba322 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Intersection Filter Run Prefix (Examples).tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Intersection Filter Run Prefix (Examples).tid @@ -1,6 +1,6 @@ created: 20211128212902292 -modified: 20211128233320674 -tags: [[Filter Syntax]] [[Filter Run Prefix Examples]] [[Intersection Filter Run Prefix]] +modified: 20230305125354209 +tags: [[Intersection Filter Run Prefix]] title: Intersection Filter Run Prefix (Examples) type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/syntax/Intersection Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/Intersection Filter Run Prefix.tid index 2fc8dd40f..2f2f718b3 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Intersection Filter Run Prefix.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Intersection Filter Run Prefix.tid @@ -1,15 +1,20 @@ created: 20211128212902292 -modified: 20211128212904721 -tags: [[Filter Syntax]] [[Filter Run Prefix]] +from-version: 5.1.23 +modified: 20230710073322863 +rp-input: all titles from previous filter runs +rp-output: the titles that are present in both the result of this filter run and the output from previous runs +rp-purpose: find the intersection of titles from previous runs with titles in this filter +tags: [[Named Filter Run Prefix]] title: Intersection Filter Run Prefix type: text/vnd.tiddlywiki -<<.from-version "5.1.23">> - -|''purpose'' |find the intersection of titles from previous runs with titles in this filter run | -|''input'' |all titles from previous filter runs | -|''output''|the titles that are present in both the result of this filter run and the output from previous runs | +<$railroad text=""" +\start none +\end none +( ":intersection" | - ) +[[run|"Filter Run"]] +"""/> The filter output from previous runs is set aside. The `:intersection` filter run is started with all tiddler titles as input. Once this latest filter run has completed, the latest output is compared to the set-aside output. A new output is produced that contains only titles that appeared in both the set-aside output and the latest output. -[[Examples|Intersection Filter Run Prefix (Examples)]] +[[Intersection Filter Run Prefix (Examples)]] diff --git a/editions/tw5.com/tiddlers/filters/syntax/Map Filter Run Prefix (Examples).tid b/editions/tw5.com/tiddlers/filters/syntax/Map Filter Run Prefix (Examples).tid index 8d5631983..bd8152ce8 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Map Filter Run Prefix (Examples).tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Map Filter Run Prefix (Examples).tid @@ -1,6 +1,6 @@ created: 20210618134753828 -modified: 20220724162340642 -tags: [[Filter Syntax]] [[Filter Run Prefix Examples]] [[Map Filter Run Prefix]] +modified: 20230305125405422 +tags: [[Map Filter Run Prefix]] title: Map Filter Run Prefix (Examples) type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/syntax/Map Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/Map Filter Run Prefix.tid index ad36fcade..fdce6ab39 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Map Filter Run Prefix.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Map Filter Run Prefix.tid @@ -1,28 +1,33 @@ created: 20210618133745003 -modified: 20220720190146771 -tags: [[Filter Syntax]] [[Filter Run Prefix]] +from-version: 5.2.0 +modified: 20230710073315595 +rp-input: the filter output of all previous runs so far +rp-output: the input titles as modified by the result of this filter run +rp-purpose: modify input titles by the result of evaluating this filter run for each item +rp-suffix: <<.from-version "5.2.3">> <<.value flat>> to return all results from the filter run, or omit (default) to return only the first result +tags: [[Named Filter Run Prefix]] title: Map Filter Run Prefix type: text/vnd.tiddlywiki -<<.from-version "5.2.0">> - -|''purpose'' |modify input titles by the result of evaluating this filter run for each item | -|''input'' |all titles from previous filter runs | -|''suffix''|<<.from-version "5.2.3">> `flat` to return all results from the filter run, If omitted (default), only the first result is returned.| -|''output''|the input titles as modified by the result of this filter run | +<$railroad text=""" +\start none +\end none +( ":map" | - ) +[[run|"Filter Run"]] +"""/> Each input title from previous runs is passed to this run in turn. The filter run transforms the input titles and the output of this run replaces the input title. For example, the filter run `[get[caption]else{!!title}]` replaces each input title with its caption field, unless the field does not exist in which case the title is preserved. -Note that within the filter run, the "currentTiddler" variable is set to the title of the tiddler being processed. This permits filter runs like `:map[{!!price}multiply{!!cost}]` to be used for computation. The value of currentTiddler outside the run is available in the variable "..currentTiddler". +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 `:map[{!!price}multiply{!!cost}]` to be used for computation. The following variables are available within the filter run: -* ''currentTiddler'' - the input title -* ''..currentTiddler'' - the value of the variable `currentTiddler` outside the filter run. -* ''index'' - <<.from-version "5.2.1">> the numeric index of the current list item (with zero being the first item in the list). -* ''revIndex'' - <<.from-version "5.2.1">> the reverse numeric index of the current list item (with zero being the last item in the list). -* ''length'' - <<.from-version "5.2.1">> the total length of the input list. +* <<.var currentTiddler>> - the input title +* <<.var ..currentTiddler>> - the value of the variable `currentTiddler` outside the filter run. +* <<.var index>> - <<.from-version "5.2.1">> the numeric index of the current list item (with zero being the first item in the list). +* <<.var revIndex>> - <<.from-version "5.2.1">> the reverse numeric index of the current list item (with zero being the last item in the list). +* <<.var length>> - <<.from-version "5.2.1">> the total length of the input list. -Filter runs used with the `:map` prefix should return at least the same number of items that they are passed. Any missing entries will be treated as an 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]...`. +Filter runs used with the `:map` prefix should return at least the same number of items that they are passed. Input titles for which the filter run returns no output are replaced by an 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|Map Filter Run Prefix (Examples)]] \ No newline at end of file +[[Map Filter Run Prefix (Examples)]] \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/filters/syntax/Named Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/Named Filter Run Prefix.tid index 72a4bec8d..ed389b987 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Named Filter Run Prefix.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Named Filter Run Prefix.tid @@ -1,10 +1,36 @@ created: 20201214044413473 -modified: 20211118025845599 -tags: [[Filter Syntax]] +modified: 20230711090833212 +tags: [[Filter Run Prefix]] title: Named Filter Run Prefix +type: text/vnd.tiddlywiki -<$set name="prefixlist" filter="""[all[shadows+tiddlers]has[module-type]module-type[filterrunprefix]trim:prefix[$:/core/modules/filterrunprefixes/]trim:suffix[.js]addprefix["]addsuffix["]join[|]addprefix[(]addsuffix[)]]"""> -<$railroad text=<>/> - +In <<.from-version "5.1.23">> the named filter run prefixes where implemented. `:cascade`, `:map` and `:sort` have been added later as shown in the diagrams. -A named filter run prefix can precede any [[run|Filter Run]] of a [[filter expression|Filter Expression]] in place of a single-character prefix (`+`, `-` and so on). To create a new filter run prefix, create a [[Javascript module|Modules]] with a [[module-type|ModuleType]] of `filterrunprefix`. +A named filter run prefix can precede any [[run|Filter Run]] of a [[filter expression|Filter Expression]] in place of a [[shortcut run prefix|Shortcut Filter Run Prefix]]. + +<$railroad text=""" +\start none +\end none +( +[[<":all"> |"All Filter Run Prefix"]] | +[[<":and"> |"And Filter Run Prefix"]] | +[[<":cascade"> /"v5.2.1"/ |"Cascade Filter Run Prefix"]] | +[[<":else"> |"Else Filter Run Prefix"]] | +[[<":except"> |"Except Filter Run Prefix"]] | +[[<":filter"> |"Filter Filter Run Prefix"]] | +[[<":intersection"> |"Intersection Filter Run Prefix"]] | +[[<":map"> /"v5.2.0"/ |"Map Filter Run Prefix"]] | +[[<":or"> |"Or Filter Run Prefix"]] | +[[<":reduce"> |"Reduce Filter Run Prefix"]] | +[[<":sort"> /"v5.2.0"/ |"Sort Filter Run Prefix"]] | +[[<":then"> /"v5.3.0"/ |"Then Filter Run Prefix"]]) [[run|"Filter Run"]] +"""/> + + +<<.tip "Compare named filter run prefix `:filter` with [[filter Operator]] which applies a subfilter to every input title, removing the titles that return an empty result from the subfilter">> + +<<.tip "Compare named filter run prefix `:reduce` with [[reduce Operator]] which is used to used to flatten a list of items down to a single item by repeatedly applying a subfilter">> + +<<.tip """Within the filter runs prefixed with `:reduce`, `:sort`, `:map` and `:filter`, the <<.var currentTiddler>> variable is set to the title of the tiddler being processed.
The value of currentTiddler outside the subfilter is available in the variable <<.var "..currentTiddler">> <<.from-version "5.2.0">>""" >> + +Also see: [[Interchangeable Filter Run Prefixes]] diff --git a/editions/tw5.com/tiddlers/filters/syntax/Or Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/Or Filter Run Prefix.tid new file mode 100644 index 000000000..4cb9a94ec --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/Or Filter Run Prefix.tid @@ -0,0 +1,18 @@ +created: 20230318135743766 +from-version: 5.1.23 +modified: 20230322140708372 +rp-input: all titles from previous filter runs +rp-output: output titles are [[dominantly appended|Dominant Append]] to the output of previous filter runs +rp-purpose: de-duplicated union of tiddler sets +tags: [[Named Filter Run Prefix]] +title: Or Filter Run Prefix +type: text/vnd.tiddlywiki + +<$railroad text=""" +\start none +\end none +( ":or" | - ) +[[run|"Filter Run Prefix"]] +"""/> + +The :or prefix is equivalent to using no prefix at all. See `run` at [[Shortcut Filter Run Prefix]] \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/filters/syntax/Reduce Filter Run Prefix (Examples).tid b/editions/tw5.com/tiddlers/filters/syntax/Reduce Filter Run Prefix (Examples).tid index c88472216..bb17b9c8e 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Reduce Filter Run Prefix (Examples).tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Reduce Filter Run Prefix (Examples).tid @@ -1,6 +1,6 @@ created: 20211124151912931 -modified: 20211124160747921 -tags: [[Filter Syntax]] [[Reduce Filter Run Prefix]] [[Filter Run Prefix Examples]] +modified: 20230305125430544 +tags: [[Reduce Filter Run Prefix]] title: Reduce Filter Run Prefix (Examples) type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/syntax/Reduce Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/Reduce Filter Run Prefix.tid index 3a9fd8a82..6799d8e05 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Reduce Filter Run Prefix.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Reduce Filter Run Prefix.tid @@ -1,25 +1,34 @@ created: 20211124151912931 -modified: 20211124170117511 -tags: [[Filter Syntax]] [[Filter Run Prefix]] +from-version: 5.1.23 +modified: 20230710073305239 +rp-input: the filter output of all previous runs so far +rp-output: the accumulated single item +rp-purpose: replaces all filter output so far with a single item by repeatedly applying a filter run to each input title +tags: [[Named Filter Run Prefix]] title: Reduce Filter Run Prefix type: text/vnd.tiddlywiki -<<.from-version "5.1.23">> -|''purpose'' |replaces all filter output so far with a single item by repeatedly applying a filter run to each input title | -|''input'' |all titles from previous filter runs | -|''output''|the accumulated single item | +<$railroad text=""" +\start none +\end none +( ":reduce" | - ) +[[run|"Filter Run"]] +"""/> -Each input title from previous runs is passed to this run in turn. The result of each previous call to this run is made available in the next call via the variable named "accumulator". The result of the last call to this run is returned as the output. A typical use is to add up the values in a given field of each input title. + +Each input title from previous runs is passed to this run in turn. The result of each previous call to this run is made available in the next call via the variable named <<.var accumulator>>. The result of the last call to this run is returned as the output. A typical use is to add up the values in a given field of each input title. + +Replaces all filter output so far with a single item by repeatedly applying a formula, as described above, to each input title. The following variables are available within the filter run: -* ''accumulator'' - the result of the previous filter run -* ''currentTiddler'' - the input title -* ''..currentTiddler'' - the value of the variable `currentTiddler` outside the filter run. <<.from-version "5.2.0">> -* ''index'' - the numeric index of the current list item (with zero being the first item in the list) -* ''revIndex'' - the reverse numeric index of the current list item (with zero being the last item in the list) -* ''length'' - the total length of the input list +* <<.var accumulator>> - the result of the previous filter run +* <<.var currentTiddler>> - the input title +* <<.var ..currentTiddler>> - the value of the variable `currentTiddler` outside the filter run. <<.from-version "5.2.0">> +* <<.var index>> - the numeric index of the current list item (with zero being the first item in the list) +* <<.var revIndex>> - the reverse numeric index of the current list item (with zero being the last item in the list) +* <<.var length>> - the total length of the input list <<.tip "Compare named filter run prefix `:reduce` with [[reduce Operator]] which is used to flatten a list of items down to a single item by repeatedly applying a subfilter.">> @@ -35,4 +44,4 @@ is equivalent to: [tag[shopping]reduce] ``` -[[Examples|Reduce Filter Run Prefix (Examples)]] \ No newline at end of file +[[Reduce Filter Run Prefix (Examples)]] \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/filters/syntax/Shortcut Filter Run Prefixes.tid b/editions/tw5.com/tiddlers/filters/syntax/Shortcut Filter Run Prefixes.tid new file mode 100644 index 000000000..fa8bc26e1 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/Shortcut Filter Run Prefixes.tid @@ -0,0 +1,29 @@ +created: 20230305131705188 +modified: 20230710074438655 +tags: [[Filter Run Prefix]] +title: Shortcut Filter Run Prefix +type: text/vnd.tiddlywiki + +Shortcut prefixes are commonly used by advanced users because they are fast to type but they are harder to read by less experienced users. That's why [[named prefixes|Named Filter Run Prefix]] have been created, which are more verbose. Shortcut and named filter run prefixes are interchangeable as shown in the table below. + +<$railroad text=""" +\start none +\end none +(-|:"+"|"-"|"~"|"=") +[[run|"Filter Run"]] +"""/> + +If a run has: + +* no prefix, its output titles are [[dominantly appended|Dominant Append]] to the filter's output + +* the prefix `+`, it receives the filter output so far as its input; its output then <<.em "replaces">> all filter output so far and forms the input for the next run + +* the prefix `-`, output titles are <<.em removed>> from the filter's output (if such tiddlers exist) + +* the prefix `~`, if the filter output so far is an empty list then the output titles of the run are [[dominantly appended|Dominant Append]] to the filter's output. If the filter output so far is not an empty list then the run is ignored. <<.from-version "5.1.18">> + +* the prefix `=`, output titles are appended to the filter's output without de-duplication. <<.from-version "5.1.20">> + + +{{Interchangeable Filter Run Prefixes}} \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix (Examples).tid b/editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix (Examples).tid index 73c95643e..16b9c9711 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix (Examples).tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix (Examples).tid @@ -1,6 +1,6 @@ created: 20210428074912172 -modified: 20210428085746041 -tags: [[Filter Syntax]] [[Sort Filter Run Prefix]] [[Filter Run Prefix Examples]] +modified: 20230315165343329 +tags: [[Sort Filter Run Prefix]] title: Sort Filter Run Prefix (Examples) type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid index ec5e032dd..0197425ad 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Sort Filter Run Prefix.tid @@ -1,19 +1,26 @@ created: 20210428083929749 -modified: 20210522162628946 -tags: [[Filter Syntax]] [[Filter Run Prefix]] +from-version: 5.2.0 +modified: 20230322140722470 +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 -<<.from-version "5.2.0">> - -|''purpose'' |sort the input titles by the result of evaluating this filter run for each item | -|''input'' |all titles from previous filter runs | -|''suffix'' |the `:sort` filter run prefix uses a rich suffix, see below for details | -|''output''|the sorted result of previous filter runs | +<$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"/ | - ) +[[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 "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 currentTiddler outside the run is available in the variable "..currentTiddler". +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: diff --git a/editions/tw5.com/tiddlers/filters/syntax/then Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/then Filter Run Prefix.tid index 2584bd65b..b74000b5a 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/then Filter Run Prefix.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/then Filter Run Prefix.tid @@ -1,45 +1,14 @@ created: 20210618133745003 from-version: 5.3.0 -modified: 20230506172920710 +modified: 20230710074225410 rp-input: <<.olink all>> tiddler titles rp-output: the output of this filter run replaces the output of previous runs unless it is an empty list (see below) rp-purpose: replace any input to this filter run with its output, only evaluating the run when there is any input search: -tags: [[Filter Run Prefix]] [[Filter Syntax]] +tags: [[Named Filter Run Prefix]] title: Then Filter Run Prefix type: text/vnd.tiddlywiki -\define .op-row() -<$macrocall $name=".if" - cond="""$(op-body)$""" - then="""$(op-head)$<<.op-place>>$(op-body)$""" - else=""/> -\end - -<$list filter="[all[current]has[from-version]]" variable="listItem"> - <$macrocall $name=".from-version" version={{!!from-version}}/> - -<$let op-head="" op-body="" op-name=""> - - - <$let op-head="purpose" op-body={{!!rp-purpose}}> - <<.op-row>> - - - <$let op-head="[[input|Filter Expression]]" op-body={{!!rp-input}}> - <<.op-row>> - - - <$let op-head="suffix" op-body={{!!rp-suffix}} op-name={{!!rp-suffix-name}}> - <<.op-row>> - - - <$let op-head="output" op-body={{!!rp-output}}> - <<.op-row>> - -
- - <$railroad text=""" \start none \end none @@ -47,8 +16,6 @@ type: text/vnd.tiddlywiki [[run|"Filter Run"]] """/> -!Introduction - The <<.op :then>> filter run prefix is used to replace the result of all previous filter runs with its output. If the result of all previous runs is an empty list, the <<.op :then>> prefixed filter run is not evaluated. @@ -67,5 +34,5 @@ The major difference between the <<.op then>> operator and a <<.op :then>> prefi |^<<.operator-example m1-1 "[tag[WikiText]] :then[[true]]">>|^<<.operator-example m1-2 "[tag[WikiText]then[true]]">>

To make them equivalent, additional filter steps may be added:

<<.operator-example m1-3 "[tag[WikiText]count[]compare:number:gt[0]then[true]]">>| -! [[Examples|Then Filter Run Prefix (Examples)]] +[[Then Filter Run Prefix (Examples)]] diff --git a/editions/tw5.com/tiddlers/filters/toggle Operator.tid b/editions/tw5.com/tiddlers/filters/toggle Operator.tid index 13e971990..10fbadf2c 100644 --- a/editions/tw5.com/tiddlers/filters/toggle Operator.tid +++ b/editions/tw5.com/tiddlers/filters/toggle Operator.tid @@ -4,7 +4,7 @@ modified: 20201118192155504 op-input: a list of items op-output: the input list with the title specified in the parameter toggled op-parameter: the <<.op toggle>> operator accepts 1 or more parameters, see below for details -op-purpose: toggle the title specified in the operand in the input +op-purpose: toggle the title specified in the parameter in the input tags: [[Filter Operators]] [[Listops Operators]] [[Order Operators]] title: toggle Operator type: text/vnd.tiddlywiki @@ -19,7 +19,7 @@ The <<.op toggle>> operator requires at least one parameter and can accept addit * ''title1'' : a title to toggle in the input list. If it is already present, it is removed. Otherwise, it is added. * ''title2'': (optional). When the second parameter is provided, the operator toggles between the two values in the input list. If neither is present, the first parameter takes precedence is added to the list. -With more than two parameters, the <<.op toggle>> behaves similar to the [[cycle|cycle Operator]] and can be used to cycle through a list of values. Note that all operands should be unique. +With more than two parameters, the <<.op toggle>> behaves similar to the [[cycle|cycle Operator]] and can be used to cycle through a list of values. Note that all parameters should be unique. <$macrocall $name=".tip" _="While the <<.op cycle>> operator interprets its first parameter as a list of titles to cycle through and offers similar functionality, the <<.op toggle>> operator accepts an unlimited number of distinct parameters."/> diff --git a/editions/tw5.com/tiddlers/system/TableOfContents.tid b/editions/tw5.com/tiddlers/system/TableOfContents.tid index aada8d741..d22420a9f 100644 --- a/editions/tw5.com/tiddlers/system/TableOfContents.tid +++ b/editions/tw5.com/tiddlers/system/TableOfContents.tid @@ -1,8 +1,8 @@ caption: {{$:/language/SideBar/Contents/Caption}} created: 20140809114010378 -list: HelloThere Learning [[Working with TiddlyWiki]] [[Customise TiddlyWiki]] Features Languages Editions Plugins Platforms Reference Community About +list: HelloThere Learning [[Working with TiddlyWiki]] [[Customise TiddlyWiki]] Features Filters Languages Editions Plugins Platforms Reference Community About list-after: $:/core/ui/SideBar/Open -modified: 20150414070242411 +modified: 20230322150307580 tags: $:/tags/SideBar title: TableOfContents type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/system/filter-run-template.tid b/editions/tw5.com/tiddlers/system/filter-run-template.tid new file mode 100644 index 000000000..f812cdb96 --- /dev/null +++ b/editions/tw5.com/tiddlers/system/filter-run-template.tid @@ -0,0 +1,49 @@ +code-body: yes +created: 20230316112235083 +list-before: $:/core/ui/ViewTemplate/body +modified: 20230326145802667 +tags: $:/tags/ViewTemplate +title: $:/editions/tw5.com/filter-run-template +type: text/vnd.tiddlywiki + +\define .op-place() +<$macrocall $name=".if" + cond="""$(op-name)$""" + then="<<.place '$(op-name)$'>> = " + else=""/> +\end + +\define .op-row() +<$macrocall $name=".if" + cond="""$(op-body)$""" + then="""$(op-head)$<<.op-place>>$(op-body)$""" + else=""/> +\end + +\whitespace trim + +<$list filter="[all[current]tag[Named Filter Run Prefix]]"> + <$let op-head="" op-body="" op-name=""> + + + <$let op-head="purpose" op-body={{!!rp-purpose}}> + <<.op-row>> + + + <$let op-head="[[input|Filter Expression]]" op-body={{!!rp-input}}> + <<.op-row>> + + + <$let op-head="[[suffix|Filter Run Prefix]]" op-body={{!!rp-suffix}} op-name={{!!rp-suffix-name}}> + <<.op-row>> + + + <$let op-head="output" op-body={{!!rp-output}}> + <<.op-row>> + +
+ <$list filter="[all[current]has[from-version]]" variable="listItem"> + <$macrocall $name=".from-version" version={{!!from-version}}/> + + + diff --git a/editions/tw5.com/tiddlers/system/operator-template.tid b/editions/tw5.com/tiddlers/system/operator-template.tid index 4d7abc334..88bee6a24 100644 --- a/editions/tw5.com/tiddlers/system/operator-template.tid +++ b/editions/tw5.com/tiddlers/system/operator-template.tid @@ -2,82 +2,63 @@ created: 20150203173506000 list-before: $:/core/ui/ViewTemplate/body modified: 20230602181119360 tags: $:/tags/ViewTemplate +code-body: yes title: $:/editions/tw5.com/operator-template \define .op-place() <$macrocall $name=".if" - cond="""$(op-name)$""" - then="<<.place '$(op-name)$'>> = " - else=""/> + cond="""$(op-name)$""" + then="<<.place '$(op-name)$'>> = " + else=""/> \end \define .op-row() <$macrocall $name=".if" - cond="""$(op-body)$""" - then="""$(op-head)$<<.op-place>>$(op-body)$""" - else=""/> + cond="""$(op-body)$""" + then="""$(op-head)$<<.op-place>>$(op-body)$""" + else=""/> \end -<$set name="op-head" value=""> -<$set name="op-body" value=""> -<$set name="op-name" value=""> +\whitespace trim + <$list filter="[all[current]tag[Filter Operators]]"> - - -<$set name="op-head" value="purpose"> -<$set name="op-body" value={{!!op-purpose}}> -<<.op-row>> - - - -<$set name="op-head" value="[[input|Filter Syntax]]"> -<$set name="op-body" value={{!!op-input}}> -<<.op-row>> - - - -<$set name="op-head" value="`!` input"> -<$set name="op-body" value={{!!op-neg-input}}> -<<.op-row>> - - - -<$set name="op-head" value="[[suffix|Filter Step]]"> -<$set name="op-body" value={{!!op-suffix}}> -<$set name="op-name" value={{!!op-suffix-name}}> -<<.op-row>> - - - - -<$set name="op-head" value="[[parameter|Filter Parameter]]"> -<$set name="op-body" value={{!!op-parameter}}> -<$set name="op-name" value={{!!op-parameter-name}}> -<<.op-row>> - - - - -<$set name="op-head" value="output"> -<$set name="op-body" value={{!!op-output}}> -<<.op-row>> - - - -<$set name="op-head" value="`!` output"> -<$set name="op-body" value={{!!op-neg-output}}> -<<.op-row>> - - - -
+ <$let op-head="" op-body="" op-name=""> + + + <$let op-head="purpose" op-body={{!!op-purpose}}> + <<.op-row>> + + + <$let op-head="[[input|Filter Syntax]]" op-body={{!!op-input}}> + <<.op-row>> + + + <$let op-head="`!` input" op-body={{!!op-neg-input}}> + <<.op-row>> + + + <$let op-head="[[suffix|Filter Step]]" op-body={{!!op-suffix}} op-name={{!!op-suffix-name}}> + <<.op-row>> + + + <$let op-head="[[parameter|Filter Parameter]]" op-body={{!!op-parameter}} op-name={{!!op-parameter-name}}> + <<.op-row>> + + + <$let op-head="output" op-body={{!!op-output}}> + <<.op-row>> + + + <$let op-head="`!` output" op-body={{!!op-neg-output}}> + <<.op-row>> + +
+

+ [[Learn more about how to use Filters|Filters]] +

-

[[Learn more about how to use Filters|Filters]]

- -<$list filter="[all[current]has[from-version]]" variable="listItem"> -

<$macrocall $name=".from-version" version={{!!from-version}}/>

+ <$list filter="[all[current]has[from-version]]" variable="listItem"> + <$macrocall $name=".from-version" version={{!!from-version}}/> + + - - - - diff --git a/editions/tw5.com/tiddlers/wikitext/Transclusion and Substitution.tid b/editions/tw5.com/tiddlers/wikitext/Transclusion and Substitution.tid index 15dd9b4cc..b63d9a0a0 100644 --- a/editions/tw5.com/tiddlers/wikitext/Transclusion and Substitution.tid +++ b/editions/tw5.com/tiddlers/wikitext/Transclusion and Substitution.tid @@ -27,7 +27,7 @@ As described in [[HTML in WikiText]], you can also transclude tiddler field valu <$text text={{MyTiddler}}/> ``` -As described in [[Introduction to filter notation]], you can also transclude tiddler field values as filter operands. For example: +As described in [[Introduction to filter notation]], you can also transclude tiddler field values using the [[filter syntax|Filter Syntax]]. For example: ``` {{{ [tag{TiddlerContainingMyTag}] }}} @@ -47,7 +47,7 @@ As described in [[HTML in WikiText]], you can also transclude a variable as the <$text text=<>/> ``` -As described in [[Introduction to filter notation]], you can also transclude a variable as the value of a filter operand. For example: +As described in [[Introduction to filter notation]], you can also transclude a variable as the value of a filter parameter using the [[filter syntax|Filter Syntax]]. For example: ``` {{{ [tag] }}}