Skip to content

Commit

Permalink
[DOCS] Improve "each operator" links (#8798)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmario authored Dec 5, 2024
1 parent 59548f0 commit 86d3e95
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
16 changes: 8 additions & 8 deletions editions/tw5.com/tiddlers/demonstrations/GroupedLists.tid
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
title: GroupedLists
tags: ListWidget Lists
created: 20150106180000000
modified: 20150221230117000
modified: 20241204085601176
tags: ListWidget Lists
title: GroupedLists

The following sidebar tabs give examples of grouped lists created by nesting.

!! Types Tab
!! [[Types Tab|$:/core/ui/MoreSideBar/Types]]

For the [[Types|$:/core/ui/MoreSideBar/Types]] tab, the outer list filter as shown below selects each discrete value found in the `type` field. The inner list filter selects all the (non-system) tiddlers with that type.
For the "Types Tab", the outer list filter as shown below selects each discrete value found in the `type` field. The inner list filter selects all the (non-system) tiddlers with that type.

<<tw-code "$:/core/ui/MoreSideBar/Types">>

!! Recent Tab
!! [[Recent Tab|$:/core/ui/SideBar/Recent]]

The list in the [[Recent|$:/core/ui/SideBar/Recent]] tab is generated using the <<.mlink timeline>> macro. Here, the outer list filter selects each discrete day found in the `modified` field, while the inner list filter selects all the tiddlers dated the same day in the `modified` field.
The list in the "Recent Tab" is generated using the <<.mlink timeline>> macro. Here, the outer list filter selects each discrete day found in the `modified` field, while the inner list filter selects all the tiddlers dated the same day in the `modified` field.

<<tw-code-link "$:/core/macros/timeline">>
<<tw-code "$:/core/macros/timeline">>
18 changes: 10 additions & 8 deletions editions/tw5.com/tiddlers/filters/each.tid
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
created: 20140410103123179
modified: 20191209085901849
tags: [[Filter Operators]] [[Group Operators]]
title: each Operator
type: text/vnd.tiddlywiki
caption: each
op-purpose: select one of each group of input titles by field
created: 20140410103123179
modified: 20241204090042816
op-input: a [[selection of titles|Title Selection]]
op-suffix: optionally, `list-item` or `value`
op-output: a selection containing the first input title encountered for each distinct value of field <<.place F>>
op-parameter: the name of a [[field|TiddlerFields]], defaulting to <<.field title>>
op-parameter-name: F
op-output: a selection containing the first input title encountered for each distinct value of field <<.place F>>
op-purpose: select one of each group of input titles by field
op-suffix: optionally, `list-item` or `value`
tags: [[Filter Operators]] [[Group Operators]]
title: each Operator
type: text/vnd.tiddlywiki

Each input title is processed in turn. The value of field <<.place F>> in the corresponding tiddler is examined.

Expand All @@ -22,4 +22,6 @@ Each input title is processed in turn. The value of field <<.place F>> in the co

Note that if a tiddler does not contain field <<.place F>>, it is treated as if the value of the field were empty. Thus, a filter expression such as `[each[motovun]]` will return one tiddler that doesn't have a `motovun` field, as well as one tiddler with each distinct value of that field, if any. To obtain just the tiddlers that have a non-blank value for the `motovun` field one can use `[each[motovun]has[motovun]]`.

<<.note"""For an example of using the <<.op each>> operator to generate a two-tier list of groups and members, see [[GroupedLists]].""">>

<<.operator-examples "each">>
4 changes: 1 addition & 3 deletions editions/tw5.com/tiddlers/filters/examples/each.tid
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20150118134611000
modified: 20150118183152000
modified: 20241204085904594
tags: [[each Operator]] [[Operator Examples]]
title: each Operator (Examples)
type: text/vnd.tiddlywiki
Expand All @@ -9,5 +9,3 @@ type: text/vnd.tiddlywiki
<<.operator-example 3 "[each:list-item[list]]" "all tiddlers listed anywhere in the core list field">>
<<.operator-example 4 "[[Non existing]] [[GettingStarted]] +[each:value[]]" "Compare this to `+[each[]]` below">>
<<.operator-example 5 "[[Non existing]] [[GettingStarted]] +[each[]]" "Compare this to `+[each:value[]]` above">>

For an example of using the <<.op each>> operator to generate a two-tier list of groups and members, see [[GroupedLists]].

0 comments on commit 86d3e95

Please sign in to comment.