Skip to content

Commit

Permalink
docs: Add task.lineNumber to 'Grouping'
Browse files Browse the repository at this point in the history
  • Loading branch information
claremacrae committed Feb 18, 2025
1 parent cd7e6b1 commit adeefa7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
13 changes: 13 additions & 0 deletions docs/Queries/Grouping.md
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,19 @@ group by function task.originalMarkdown.replace(/^[^\[\]]+\[.\] */, '')
<!-- placeholder to force blank line after included text --><!-- endInclude -->
### Line Number
There is no built-in instruction to group by the task's line number.

Since Tasks X.Y.Z, **[[Custom Sorting|custom sorting]] by the task's line number** is now possible, using `task.lineNumber`.
> [!tip]
> With `task.lineNumber`, the first line in the file is on line number `0` (zero), not `1` (one).
<!-- placeholder to force blank line before included text --><!-- include: CustomGroupingExamples.test.other_properties_task.lineNumber_docs.approved.md -->
<!-- placeholder to force blank line after included text --><!-- endInclude -->
## Group by File Properties
### File Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ describe('other properties', () => {
'task.lineNumber',
// comment to force line break
[],
SampleTasks.withRepresentativeTags(),
SampleTasks.withRepresentativeLineNumbers(),
],

[
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- placeholder to force blank line before included text -->



<!-- placeholder to force blank line after included text -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Results of custom groupers


Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,13 @@ describe('other properties', () => {
SampleTasks.withRepresentativeTags(),
],

[
'task.lineNumber',
// comment to force line break
[],
SampleTasks.withRepresentativeLineNumbers(),
],

[
'task.urgency',
[
Expand Down

0 comments on commit adeefa7

Please sign in to comment.