Hi,
Thanks for creating this tool. There is alot of potential here and I’m enjoying learning how it works.
TLDR: I’d like to extend tasks plug to recognize headings as tasks.
One of the previous PKM tools I’ve used is org-mode in emacs. With org-mode, you define tasks using headings, which allows you to summarize task in headings and then add further details in text under headings. This was really helpful for adding logs/details as I worked on task.
Since moving markdown tools like silverbullet and obsidian, I’ve missed the ability to add ton of details to a task. Using lists as tasks is great for simple tasks, but it breaks down quick when you want to add more into to tasks.
I’m considering writing a plug to recognize headings as tasks. For this, I think I’ll need to figure out a way to configure tasks at heading level. Some thoughts I’ve had:
set properties at heading level
use a custom code block to assign “metadata/frontmatter” to headings
What do folks think of this idea? Or do any of you have suggestions/advice as to how to go about implementing this?
It’s not the same as a task, but I make specific headings traceable by adding attributes to them: Attributes
You can then query them like tasks
Or you can add the #task/[tag: task] tag and it will show up in the same query with the list tasks. You can mark them completed by adding [done: true]. It’s a bit uglier, but same effect.
Example query to get the tasks:
${query[[from index.tag "task" where level and not done]]}
Headings have a level attribute that can be used to find them. So we can filter the tasks based on whether they have this attribute or not.
There’s probably also a way to set the done attribute with a command.
I’ve been playing around a bit with space-lua and you could do something like this:
Define a task with a heading (one or more pound symbols)
# My very detailed task #task
With some accompanying text.
Add this command in a space-lua block:
command.define {
name = "Big Task: Mark Completed",
run = function()
local pos = editor.getCursor()
local pageText = editor.getText():sub(1, pos)
local lineStart, lineEnd = 0, 0
while lineStart < 1 and pos > 0 do
lineStart, lineEnd = pageText:find("#+ ", pos)
pos = pos - 1
end
editor.insertAtPos("✅ ", lineEnd - 1)
end
}
And use this query:
${query[[from index.tag "task" where level and not name:startsWith("✅")]]}
Running the command will mark the task closest to the cursor (looking backwards) as completed by prepending the ‘title’ with a checkmark The query then filters these tasks out to only show open tasks.
Wow, thank you for your suggestions. My next task, figure out how to you this for my workflow.
I’m glad to learn that this is already somewhat part of api.