Skip to content

Commit 09f2f65

Browse files
committed
docs: Document reverse sorting of groups
1 parent 606600d commit 09f2f65

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

docs/Introduction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ publish: true
66

77
## What's New?
88

9+
- X.Y.Z: 🔥 Add [[Grouping#Reversing groups|reverse sorting of groups]]
910
- 3.6.0: 🔥 Add [[Grouping#Other task properties|group by urgency]]
1011
- 3.6.0: 🔥 Add [[Sorting#Other task properties|sort by recurring]]
1112
- 3.5.0: 🔥 New [[Global Query]] facility.

docs/Queries/Grouping.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,29 @@ See the [screenshots below](#screenshots) for how this looks in practice.
116116
> [!info]
117117
> Headings are displayed in case-sensitive alphabetical order, not the original order.
118118
119-
---
119+
## Reversing groups
120+
121+
> [!released]
122+
> Reversing of group headings was introduced in Tasks X.Y.Z.
123+
124+
After the name of the property that you want to group by, you can add the `reverse` keyword.
125+
If given, the group headings will be reversed for that property.
126+
127+
For example:
128+
129+
- `group by due` will sort the group headings:
130+
- from **oldest** due date first...
131+
- to **newest** due date last
132+
- `group by due reverse` will sort the group headings:
133+
- from **newest** due date first...
134+
- to **oldest** due date last
135+
136+
> [!tip]
137+
> The `reverse` keyword controls the order that group headings are displayed.
138+
>
139+
> The [[Sorting|sort by]] facility, by contrast, controls the order in which displays are displayed *inside* each group.
140+
141+
## Notes
120142

121143
> [!info]
122144
> The order of operations ensures that grouping does not modify which tasks are displayed, for example when the `limit` option is used:
@@ -148,9 +170,19 @@ Tasks grouped.
148170

149171
## Examples
150172

173+
Give me three levels of grouping, to indicate the locations of my tasks:
174+
151175
```tasks
152176
not done
153177
group by folder
154178
group by filename
155179
group by heading
156180
```
181+
182+
Show me tasks I need to do today - and put today's tasks first, for visibility:
183+
184+
```tasks
185+
not done
186+
due before tomorrow
187+
group by due reverse
188+
```

0 commit comments

Comments
 (0)