1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 05:19:57 +00:00

Merge branch 'tiddlywiki-com'

This commit is contained in:
Jeremy Ruston 2024-07-18 08:29:55 +01:00
commit 4f3f09d223
5 changed files with 58 additions and 23 deletions

View File

@ -0,0 +1,11 @@
created: 20240710161501472
list-after: $:/core/ui/ViewTemplate/body
modified: 20240713020832439
tags: $:/tags/ViewTemplate
title: $:/editions/tw5.com/empty-tag-node-template
type:
<$list filter='[<storyTiddler>!has[text]] :filter[tagging[]]'>
The following tiddlers are tagged with <<tag>>:
</$list>
<<list-links filter:"[<storyTiddler>!has[text]tagging[]]" class:"multi-columns">>

View File

@ -1,6 +1,6 @@
caption: sortsub caption: sortsub
created: 20200424160155182 created: 20200424160155182
modified: 20210522162521222 modified: 20240717115735166
op-input: a [[selection of titles|Title Selection]] op-input: a [[selection of titles|Title Selection]]
op-neg-output: the input, sorted into reverse order by the result of evaluating subfilter <<.param S>> op-neg-output: the input, sorted into reverse order by the result of evaluating subfilter <<.param S>>
op-output: the input, sorted into ascending order by the result of evaluating subfilter <<.param S>> op-output: the input, sorted into ascending order by the result of evaluating subfilter <<.param S>>
@ -15,19 +15,23 @@ type: text/vnd.tiddlywiki
Each item in the list of input titles is passed to the subfilter in turn. The subfilter transforms the input titles into the form needed for sorting. For example, the subfilter `[length[]]` transforms each input title in the number representing its length, and thus sorts the input titles according to their length. Each item in the list of input titles is passed to the subfilter in turn. The subfilter transforms the input titles into the form needed for sorting. For example, the subfilter `[length[]]` transforms each input title in the number representing its length, and thus sorts the input titles according to their length.
Note that within the subfilter, the "currentTiddler" variable is set to the title of the tiddler being processed. This permits subfilters like `[{!!value}divide{!!cost}]` to be used for computation. Note that within the subfilter <<.place S>>, the <<.var currentTiddler>> variable is set to the title of the tiddler being processed. This permits subfilters like `[{!!value}divide{!!cost}]` to be used for computation.
The value of currentTiddler outside the subfilter is available in the variable "..currentTiddler". <<.from-version "5.2.0">> The value of <<.var currentTiddler>> outside the subfilter is available in the variable <<.var ..currentTiddler>>. <<.from-version "5.2.0">>
The suffix <<.place T>> determines how the items are compared and can be: The suffix <<.place T>> determines how the items are compared and can be:
* "string" (the default) * ''string'' (the default)
* "number" - invalid numbers are interpreted as zero * ''number'' - invalid numbers are interpreted as zero
* "integer" - invalid integers are interpreted as zero * ''integer'' - invalid integers are interpreted as zero
* "date" - invalid dates are interpreted as 1st January 1970 * ''date'' - invalid dates are interpreted as 1st January 1970
* "version" - invalid versions are interpreted as "v0.0.0" * ''version'' - invalid versions are interpreted as "v0.0.0"
* "alphanumeric" - treat items as alphanumerics <<.from-version "5.2.0">> * ''alphanumeric'' - treat items as alphanumerics <<.from-version "5.2.0">>
Note that subfilters should return the same number of items that they are passed. Any missing entries will be treated as zero or the empty string. In particular, when retrieving the value of a field with the [[get Operator]] it is helpful to guard against a missing field value using the [[else Operator]]. For example `[get[myfield]else[default-value]...`. <<.tip """Note that subfilters <<.place S>> ''should return the same number of items that they are passed''. In particular, when retrieving the value of a field with the <<.olink get>> operator it is helpful to guard against a missing field value using the <<.olink else>> operator. For example `...[get[myfield]else[default-value]]`.<br><br>
Any ''missing'' entries will be treated as ''zero'' or the ''empty string''.""">>
Also see: [[Sort Filter Run Prefix]]
<<.operator-examples "sortsub">> <<.operator-examples "sortsub">>

View File

@ -1,10 +1,11 @@
created: 20210428083929749 created: 20210428083929749
from-version: 5.2.0 from-version: 5.2.0
modified: 20240312203002082 modified: 20240717120111427
rp-input: the filter output of all previous runs so far rp-input: the filter output of all previous runs so far
rp-output: output titles replace the output of previous filter runs 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-purpose: sort the input titles by the result of evaluating this filter run for each item
rp-suffix: the <<.op :sort>> filter run prefix uses a rich suffix, see below for details rp-suffix: the :sort filter run prefix uses a rich suffix, see below for details
rp-suffix-name: S
tags: [[Named Filter Run Prefix]] tags: [[Named Filter Run Prefix]]
title: Sort Filter Run Prefix title: Sort Filter Run Prefix
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
@ -12,9 +13,19 @@ type: text/vnd.tiddlywiki
<$railroad text=""" <$railroad text="""
\start none \start none
\end none \end none
( ( ":sort" ) ( ":sort" )
( : ":string" | ":alphanumeric" | ":number" | ":integer" | ":version" | ":date" ) ( ":" )
( : ":casesensitive" /"required for string and alphanumeric"/ | ":caseinsensitive" /"required for string and alphanumeric"/ | ":reverse" /"optional"/ | - ) | - ) ( : "string" | "alphanumeric" | "number" | "integer" | "version" | "date" )
( ":" )
{
(
(
( : "caseinsensitive" /"required for string and alphanumeric"/ | "casesensitive" /"required for string and alphanumeric"/)
| "reverse" /"optional"/
)
)
+","
}
[[run|"Filter Run"]] [[run|"Filter Run"]]
"""/> """/>
@ -22,7 +33,7 @@ Each input title from previous runs is passed to this run in turn. The filter ru
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">>. Note that within the filter run, the <<.var currentTiddler>> variable is set to the title of the tiddler being processed. This permits filter runs like `:sort:number[{!!value}divide{!!cost}]` to be used for computation. The value of <<.var currentTiddler>> outside the run is available in the variable <<.var "..currentTiddler">>.
The `:sort` filter run prefix uses an extended syntax that allows for multiple suffixes, some of which are required: The `:sort` <<.place S>> filter run prefix uses an extended syntax that allows for multiple suffixes, some of which are required:
``` ```
:sort:<type>:<flaglist>[...filter run...] :sort:<type>:<flaglist>[...filter run...]
@ -30,10 +41,19 @@ The `:sort` filter run prefix uses an extended syntax that allows for multiple s
``` ```
* ''type'': Required. Determines how the items are compared and can be any of: ''string'', ''alphanumeric'', ''number'', ''integer'', ''version'' or ''date''. * ''type'': Required. Determines how the items are compared and can be any of: ''string'', ''alphanumeric'', ''number'', ''integer'', ''version'' or ''date''.
* ''flaglist'': comma separated list of the following flags: * ''flaglist'': comma separated list of the following flags:
** ''casesensitive'' or ''caseinsensitive'' (required for types `string` and `alphanumeric`). ** ''casesensitive'' or ''caseinsensitive'' (required for types `string` and `alphanumeric`).
*** defaults to: //caseinsensitive// if the flag is missing.
*** for clarity this parameter should be always defined.
** ''reverse'' to invert the order of the filter run (optional). ** ''reverse'' to invert the order of the filter run (optional).
Note that filter runs used with the `:sort` prefix should return the same number of items that they are passed. Any missing entries will be treated as zero or the empty string. In particular, when retrieving the value of a field with the [[get Operator]] it is helpful to guard against a missing field value using the [[else Operator]]. For example `[get[myfield]else[default-value]...`. <<.tip """Note that filter runs used with the `:sort` prefix ''should return the same number of items that they are passed''. In particular, when retrieving the value of a field with the [[get Operator]] it is helpful to guard against a missing field value using the [[else Operator]]. For example `...[get[myfield]else[default-value]]`.<br><br>
Any ''missing'' entries will be treated as ''zero'' or the ''empty string''.""">>
Also see: <<.olink sortsub>> Operator
[[Examples|Sort Filter Run Prefix (Examples)]] [[Examples|Sort Filter Run Prefix (Examples)]]

View File

@ -1,19 +1,19 @@
created: 20220719120233104 created: 20220719120233104
list-after: $:/core/ui/ViewTemplate/body list-after: $:/core/ui/ViewTemplate/body
modified: 20220719120319922 modified: 20240710163659672
tags: $:/tags/ViewTemplate tags: $:/tags/ViewTemplate
title: $:/editions/tw5.com/systemtag-template title: $:/editions/tw5.com/systemtag-template
<$list filter='[all[current]prefix[SystemTag: ]]'> <$list filter='[all[current]prefix[SystemTag: ]]'>
<$let tag={{{ [all[current]removeprefix[SystemTag: ]] }}} > <$let thisTag={{{ [all[current]removeprefix[SystemTag: ]] }}} >
<$list filter='[all[tiddlers+shadows]tag<tag>limit[1]]' emptyMessage='(No tiddlers are currently tagged with <<tag>> )'> <$list filter='[all[tiddlers+shadows]tag<thisTag>limit[1]]' emptyMessage='(No tiddlers are currently tagged with <<tag>> )'>
The following tiddlers are tagged with <<tag>> The following tiddlers are tagged with <<tag $(thisTag)$ >>
<table> <table>
<tr><th></th><th>caption</th></tr> <tr><th></th><th>caption</th></tr>
<$list filter='[all[tiddlers+shadows]tag<tag>sort[]]'> <$list filter='[all[tiddlers+shadows]tag<thisTag>sort[]]'>
<tr> <tr>
<td><$link/></td> <td><$link/></td>
<td><$transclude field="caption"><$transclude field="description"><$view field="title"/></$transclude></$transclude></td> <td><$transclude field="caption"><$transclude field="description"><$view field="title"/></$transclude></$transclude></td>