You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Queries/Layout.md
+60-2Lines changed: 60 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,7 @@ hide created date
61
61
62
62
The following query elements exist:
63
63
64
+
-`tree`
64
65
-`edit button`
65
66
-`postpone button`
66
67
-`backlink`
@@ -70,16 +71,73 @@ The following query elements exist:
70
71
> [!released]
71
72
>
72
73
> -`urgency` was introduced in Tasks 1.14.0.
74
+
> -`tree` was introduced in Tasks X.Y.Z.
73
75
74
-
All of these query elements except `urgency` are shown by default, so you will use the command `hide`
75
-
if you do not want to show any of them, or the command `show` to show the urgency score.
76
+
All of these query elements except `urgency`and `tree`are shown by default, so you will use the command `hide`
77
+
if you do not want to show any of them, or the command `show` to show the urgency score or tree view.
76
78
77
79
For example:
78
80
79
81
```text
80
82
hide task count
81
83
```
82
84
85
+
### Hide and Show Tree
86
+
87
+
> [!Tip]
88
+
> The new instruction `show tree` is the first in a long series of steps to teach the Tasks plugin to fully handle [nested tasks and list items](https://help.obsidian.md/Editing+and+formatting/Basic+formatting+syntax#Nesting+lists).
89
+
>
90
+
> When you use `show tree`, Tasks shows all found tasks, and **all** their nested tasks and list items (for now, regardless of whether or not the nested tasks matched the query).
91
+
92
+
#### Show Tree example
93
+
94
+
Suppose you have a note called `Party Planner`, with the following list:
95
+
96
+
```text
97
+
- [ ] Have a party
98
+
- Planning
99
+
- [x] Decide who to invite ✅ 2024-10-26
100
+
- [ ] Send out the invites
101
+
- Preparation
102
+
- [ ] Plan the menu
103
+
- **Remember Sam's dietary requests**
104
+
- [ ] Buy the food
105
+
- On the day
106
+
- [ ] Prepare the food
107
+
- [ ] Tidy up
108
+
```
109
+
110
+
And you have this Tasks query:
111
+
112
+
````text
113
+
```tasks
114
+
not done
115
+
filename includes Party Planner
116
+
117
+
show tree
118
+
hide backlink
119
+
```
120
+
````
121
+
122
+
The `show tree` instruction enables us to see the parent/child relationships in the tasks, and their nested tasks and list items:
123
+
124
+

125
+
<spanclass="caption">Sample search results with 'show tree' instruction</span>
126
+
127
+
#### How Show Tree works
128
+
129
+
> [!warning]
130
+
> If using `show tree`, please be aware of its current behaviour, detailed below.
131
+
>
132
+
> We are releasing this first version, having found to already be valuable in our own vaults.
133
+
134
+
- For now, **all child tasks and list items are displayed**, regardless of whether they match the query.
135
+
- In the screenshot above, `Decide who to invite` did not match the `not done` query, but it is still shown.
136
+
- Any **sorting instructions only affect the sorting of the left-most tasks** in the results list.
137
+
- Child tasks and list items are displayed in the order that they appear in the file. They are not affected by any `sort by` instructions.
138
+
- For now, the **tree layout is turned off by default**, whilst we explore how it should interact with the filtering instructions.
139
+
- We hope to make it the default behaviour in a future release.
140
+
83
141
## Example of show and hide
84
142
85
143
Multiple show and hide instructions can be used in a query, each on a separate line.
0 commit comments