Skip to content

Commit eb3ed96

Browse files
authored
TODO commands docs update, OR fix (#115)
* docs * support OR in outputTodoBlocks search filter
1 parent b3852c2 commit eb3ed96

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

docs/050-command-reference.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ TODO commands are multi-block commands that query multiple TODOs from your graph
197197

198198
1. Maximum amount of block references to return. Default value is `20`
199199
2. Format to output the block in. See our [Formatting](050-command-reference.md#formatting) section for more info.
200-
3. optional filter parameter based on a comma separated list (case-insensitive). Can use - in front of a word to exclude it. Examples:
200+
3. optional filter parameter based on a comma separated list (case-sensitive). Can use - in front of a word to exclude it. Examples:
201201
- toRead,Pinnacle
202202
- returns blocks with toRead AND Pinnacle in the text
203203
- toRead|Pinaccle
@@ -215,7 +215,7 @@ TODO commands are multi-block commands that query multiple TODOs from your graph
215215

216216
1. Maximum amount of block references to return. Default value is `20`
217217
2. Format to output the block in. See our [Formatting](050-command-reference.md#formatting) section for more info.
218-
3. optional filter parameter based on a comma separated list (case-insensitive). Can use - in front of a word to exclude it. Examples:
218+
3. optional filter parameter based on a comma separated list (case-sensitive). Can use - in front of a word to exclude it. Examples:
219219
- toRead,Pinnacle
220220
- returns blocks with toRead AND Pinnacle in the text
221221
- toRead|Pinaccle
@@ -231,7 +231,7 @@ TODO commands are multi-block commands that query multiple TODOs from your graph
231231

232232
1. Maximum amount of block references to return. Default value is `20`
233233
2. Format to output the block in. See our [Formatting](050-command-reference.md#formatting) section for more info.
234-
3. optional filter parameter based on a comma separated list (case-insensitive). Can use - in front of a word to exclude it. Examples:
234+
3. optional filter parameter based on a comma separated list (case-sensitive). Can use - in front of a word to exclude it. Examples:
235235
- toRead,Pinnacle
236236
- returns blocks with toRead AND Pinnacle in the text
237237
- toRead|Pinaccle
@@ -249,7 +249,7 @@ TODO commands are multi-block commands that query multiple TODOs from your graph
249249

250250
1. Maximum amount of block references to return. Default value is `20`
251251
2. Format to output the block in. See our [Formatting](050-command-reference.md#formatting) section for more info.
252-
3. optional filter parameter based on a comma separated list (case-insensitive). Can use - in front of a word to exclude it. Examples:
252+
3. optional filter parameter based on a comma separated list (case-sensitive). Can use - in front of a word to exclude it. Examples:
253253
- toRead,Pinnacle
254254
- returns blocks with toRead AND Pinnacle in the text
255255
- toRead|Pinaccle
@@ -267,7 +267,7 @@ TODO commands are multi-block commands that query multiple TODOs from your graph
267267

268268
1. Maximum amount of block references to return. Default value is `20`
269269
2. Format to output the block in. See our [Formatting](050-command-reference.md#formatting) section for more info.
270-
3. optional filter parameter based on a comma separated list (case-insensitive). Can use - in front of a word to exclude it. Examples:
270+
3. optional filter parameter based on a comma separated list (case-sensitive). Can use - in front of a word to exclude it. Examples:
271271
- toRead,Pinnacle
272272
- returns blocks with toRead AND Pinnacle in the text
273273
- toRead|Pinaccle
@@ -285,7 +285,7 @@ TODO commands are multi-block commands that query multiple TODOs from your graph
285285

286286
1. Maximum amount of block references to return. Default value is `20`
287287
2. Format to output the block in. See our [Formatting](050-command-reference.md#formatting) section for more info.
288-
3. optional filter parameter based on a comma separated list (case-insensitive). Can use - in front of a word to exclude it. Examples:
288+
3. optional filter parameter based on a comma separated list (case-sensitive). Can use - in front of a word to exclude it. Examples:
289289
- toRead,Pinnacle
290290
- returns blocks with toRead AND Pinnacle in the text
291291
- toRead|Pinaccle

src/utils/core.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,11 @@ const outputTodoBlocks = (
407407
.filter(({ text }) => !/{{(\[\[)?query(\]\])?/.test(text))
408408
.filter(({ text }) =>
409409
search.every((s) =>
410-
/^-/.test(s) ? !text.includes(s.substring(1)) : text.includes(s)
410+
s
411+
.split("|")
412+
.some((s) =>
413+
/^-/.test(s) ? !text.includes(s.substring(1)) : text.includes(s)
414+
)
411415
)
412416
);
413417
const limitArg = Number(limit);

0 commit comments

Comments
 (0)