-
-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apiV1.executeToggleTaskDoneCommand does not modify the note [by design - add to the docs] #3287
Comments
You are correct, it does not modify the note. My guess is that you have not found the documentation that explains how it works. |
|
I did. The documentation mentions that it "Executes the 'Tasks: Toggle task done' command on the supplied line string". I guess this is more of a documentation question at this point, then. "Simulate" seems like a more accurate verb than "Execute" in this scenario. The fact that the method requires the file path adds to the confusion. I can input any random string there and get the same result, regardless of whether or not the task exists in my vault, let alone in that path |
Current behaviourAh - apologies, I misread which of the two functions you are using. You are using the recently-added one, and yes, it does indeed take an existing task line. The important bit in that documentation is that it returns the edited string: Tasks has no idea where the line came from, and in fact this functionality was written by the maintainer of the Kanban plugin, where there will not even be a markdown-editing-view open. So it is still the responsibility of the caller to write the line to the correct place in their file. What are you trying to do?I would normally expect Tasks plugin users to use one of the many built-in ways of toggle a task: https://publish.obsidian.md/tasks/Editing/Toggling+and+Editing+Statuses So what is your scenario? Why put the cursor on a line and run a plugin API instead? |
I use the Full Calendar plugin to display my tasks. I can provide a callback that is called when I check the task from my calendar, allowing me to actually check it in my note. I'll just wrap the |
Do you have any suggestions for improvements to the wording of the documentation? |
It's rather subjective, but I might go with: "Simulates the 'Tasks: Toggle task done' command on the supplied line string. It returns a string representing the task if it had been toggled, updated according to a user's preferences, accounting for recurrence rules and completed status." |
I've removed the |
Steps to reproduce
- [ ] This is a task 📅 2024-04-24
Expected Behavior
The note should be updated with the task marked as completed
Current behaviour
The note is not updated
Which Operating Systems are you using?
Obsidian Version
1.7.7
Tasks Plugin Version
7.14.0
Checks
Possible solution
No response
The text was updated successfully, but these errors were encountered: