Skip to content

Commit 3ce7946

Browse files
committed
contrib: Update some code locations in Contributing Guide
Also fix out-of-date location of Filters documentation page
1 parent 0ae53a0 commit 3ce7946

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

contributing/Code/How do I add a new field to the Task class.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ For example, It's fine to have a first release of a feature without `sort by` an
1717

1818
### Store the field
1919

20-
- Add the field to [src/Task.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Task.ts)
20+
- Add the field to [src/Task/Task.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Task/Task.ts)
2121

2222
### Read and write the field
2323

2424
- Update all supported formats in [src/TaskSerializer/](https://github.com/obsidian-tasks-group/obsidian-tasks/tree/main/src/TaskSerializer)
2525

2626
### Detect edits to field value
2727

28-
- In [tests/Task.test.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/tests/Task.test.ts):
28+
- In [tests/Task/Task.test.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/tests/Task/Task.test.ts):
2929
- Add a new failing block to the `'identicalTo'` section.
3030
- Here is an existing example: ['should check path'](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/5b0831c36a80c4cde2d64a6cd281bb4b51e9a142/tests/Task.test.ts#L834-L840).
31-
- In [src/Task.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Task.ts), update `Task.identicalTo()`:
32-
- Once you have a failing test in [tests/Task.test.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/tests/Task.test.ts), implement the check for changed value of your new field in `Task.identicalTo()`.
31+
- In [src/Task/Task.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Task/Task.ts), update `Task.identicalTo()`:
32+
- Once you have a failing test in [tests/Task/Task.test.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/tests/Task/Task.test.ts), implement the check for changed value of your new field in `Task.identicalTo()`.
3333
- This important method is used to detect whether any edits of any kind have been made to a task, to detect whether task block results need to be updated.
3434
- Here is the code for the method as of 2022-11-12:
3535
- [Task.identicalTo() in 5b0831c36a80c4cde2d64a6cd281bb4b51e9a142](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/5b0831c36a80c4cde2d64a6cd281bb4b51e9a142/src/Task.ts#L732-L802)
@@ -70,4 +70,4 @@ Can be added in later releases
7070
- Update `dates.md`
7171
- Handling invalid dates
7272
- Add the new field to all sections of [resources/sample_vaults/Tasks-Demo/Manual Testing/Invalid Dates.md](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/resources/sample_vaults/Tasks-Demo/Manual%20Testing/Invalid%20Dates.md)
73-
- Update the query in the 'invalid dates' section of [docs/queries/filters.md](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/docs/queries/filters.md)
73+
- Update the query in the 'invalid dates' section of [docs/Queries/Filters.md](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/docs/Queries/Filters.md)

contributing/Code/How do I add a new task filter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ For help on writing and running the tests, see [[About Testing]]
2727
- Add to [tests/Query/Filter](https://github.com/obsidian-tasks-group/obsidian-tasks/tree/main/tests/Query/Filter) a new test file.
2828
- This should focus on testing whether or not individual Task objects, with carefully selected sample date, match the filter.
2929
- Think about edge cases.
30-
- Add the new instruction(s) to 'Query parsing' test in [tests/Query.test.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/tests/Query.test.ts)
30+
- Add the new instruction(s) to 'Query parsing' test in [tests/Query/Query.test.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/tests/Query/Query.test.ts)
3131
- This verifies that the new filter instruction has been correctly wired in to the Query class.
3232

3333
## Update doc/

contributing/Code/How does Tasks handle status changes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ You can toggle a task‘s status by:
55
| # | User mechanism | Source-code location | Toggle behaviour |
66
| --- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
77
| 1 | using the **command** (may be bound to a hotkey). | [src/Commands/ToggleDone.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Commands/ToggleDone.ts) | toggles the line directly where the cursor is in the file inside Obsidian's vault. |
8-
| 2 | clicking on a checkbox of an **inline task** in **Live Preview**. | [src/LivePreviewExtension.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/LivePreviewExtension.ts) | toggles the line directly where the checkbox is on the "document" of CodeMirror (the library that Obsidian uses to show text on screen).<br>That, in turn, updates the file in Obsidian's Vault. |
9-
| 3 | clicking on a checkbox of an **inline task** in **Reading mode**. | uses a checkbox created by `renderTaskLine()` in [src/TaskLineRenderer](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/TaskLineRenderer.ts).<br>There, the checkbox gets a click event handler. | The click event listener of 3. and 4. uses `replaceTaskWithTasks()` in [src/File.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/File.ts).<br>That, in turn, updates the file in Obsidian‘s Vault (like 1, but it needs to find the correct line). |
8+
| 2 | clicking on a checkbox of an **inline task** in **Live Preview**. | [src/Obsidian/LivePreviewExtension.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Obsidian/LivePreviewExtension.ts) | toggles the line directly where the checkbox is on the "document" of CodeMirror (the library that Obsidian uses to show text on screen).<br>That, in turn, updates the file in Obsidian's Vault. |
9+
| 3 | clicking on a checkbox of an **inline task** in **Reading mode**. | uses a checkbox created by `renderTaskLine()` in [src/Renderer/TaskLineRenderer](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Renderer/TaskLineRenderer.ts).<br>There, the checkbox gets a click event handler. | The click event listener of 3. and 4. uses `replaceTaskWithTasks()` in [src/Obsidian/File.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Obsidian/File.ts).<br>That, in turn, updates the file in Obsidian‘s Vault (like 1, but it needs to find the correct line). |
1010
| 4 | clicking on a checkbox in **query results** (same for **Reading mode** and **Live Preview**). | As 3 | As 3 |
1111
| 5 | via 'Create or edit task' **modal** Status dropdown | [src/ui/EditTask.svelte](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/ui/EditTask.svelte) and [src/Commands/CreateOrEdit.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Commands/CreateOrEdit.ts) | Not yet implemented: see [#1590](https://github.com/obsidian-tasks-group/obsidian-tasks/issues/1590) |
1212

0 commit comments

Comments
 (0)