Skip to content

Commit

Permalink
docs: Update docs for 'filter by function' accessing query properties
Browse files Browse the repository at this point in the history
  • Loading branch information
claremacrae committed Oct 29, 2023
1 parent 5ba5c6b commit dfe0b99
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ _In recent [releases](https://github.com/obsidian-tasks-group/obsidian-tasks/rel
Move the older ones down to the top of the comment block below...
-->

- X.Y.Z: 🔥 Enable [[Custom Grouping|custom grouping]] to use [[Query Properties|query properties]] directly - no placeholders required.
- X.Y.Z: 🔥 Enable [[Custom Filters|custom filters]] and [[Custom Grouping|custom grouping]] to use [[Query Properties|query properties]] directly - no placeholders required.

<!--
- 5.0.0: 🔥 Add [[Line Continuations|line continuations]].
Expand Down
22 changes: 22 additions & 0 deletions docs/Queries/Filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,12 @@ Since Tasks 4.2.0, **[[Custom Filters|custom filtering]] by file path** is now p
In Tasks 4.8.0 `task.file.pathWithoutExtension` was added.
Since Tasks X.Y.Z, the query's file path can be used conveniently in custom filters:
- `query.file.path` or
- `query.file.pathWithoutExtension`
- Useful reading: [[Query Properties]].
<!-- placeholder to force blank line before included text --><!-- include: CustomFilteringExamples.test.file_properties_task.file.path_docs.approved.md -->
```javascript
Expand Down Expand Up @@ -1181,6 +1187,11 @@ The `root` is the top-level folder of the file that contains the task, that is,
Since Tasks 4.2.0, **[[Custom Filters|custom filtering]] by root folder** is now possible, using `task.file.root`.
Since Tasks X.Y.Z, the query's file root can be used conveniently in custom filters:
- `query.file.root`
- Useful reading: [[Query Properties]].
<!-- placeholder to force blank line before included text --><!-- include: CustomFilteringExamples.test.file_properties_task.file.root_docs.approved.md -->
```javascript
Expand Down Expand Up @@ -1219,6 +1230,11 @@ This is the `folder` to the file that contains the task, which will be `/` for f
Since Tasks 4.2.0, **[[Custom Filters|custom filtering]] by folder** is now possible, using `task.file.folder`.
Since Tasks X.Y.Z, the query's file root can be used conveniently in custom filters:
- `query.file.root`
- Useful reading: [[Query Properties]].
<!-- placeholder to force blank line before included text --><!-- include: CustomFilteringExamples.test.file_properties_task.file.folder_docs.approved.md -->
```javascript
Expand Down Expand Up @@ -1278,6 +1294,12 @@ Since Tasks 4.2.0, **[[Custom Filters|custom filtering]] by file name** is now p
In Tasks 4.8.0 `task.file.filenameWithoutExtension` was added.
Since Tasks X.Y.Z, the query's file name can be used conveniently in custom filters:
- `query.file.filename` or
- `query.file.filenameWithoutExtension`
- Useful reading: [[Query Properties]].
<!-- placeholder to force blank line before included text --><!-- include: CustomFilteringExamples.test.file_properties_task.file.filename_docs.approved.md -->
```javascript
Expand Down
11 changes: 6 additions & 5 deletions docs/Scripting/Custom Filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ publish: true
- The expression must evaluate to a `boolean`, so `true` or `false`.
- There are loads of examples in [[Filters]].
- Search for `filter by function` in that file.
- Find all the supported tasks properties in [[Task Properties]] and [[Quick Reference]].
- Find all the **supported tasks properties** in [[Task Properties]] and [[Quick Reference]].
- A number of properties are only available for custom filters and grouping, and not for built-in grouping instructions.
- Find all the **supported query properties** in [[Query Properties]].
- Learn a bit about how expressions work in [[Expressions]].

## Custom filters introduction
Expand All @@ -40,12 +41,12 @@ The available task properties are also shown in the [[Quick Reference]] table.

### Available Query Properties

The Reference section [[Query Properties]] shows all the query properties available for use via [[Placeholders]] in custom filters.

Any placeholders in custom filters must be surrounded by quotes.
The Reference section [[Query Properties]] shows all the query properties available for use in custom filters.

> [!released]
> Query properties and placeholders were introduced in Tasks 4.7.0.
>
> - Query properties and placeholders were introduced in Tasks 4.7.0, accessible via Placeholders.
> - Direct access to Query properties was introduced in Tasks X.Y.Z.
### Expressions

Expand Down

0 comments on commit dfe0b99

Please sign in to comment.