1
0
silverbullet/website/Plugs/Tasks.md

55 lines
1.9 KiB
Markdown
Raw Normal View History

---
tags: plug
---
The Tasks plug implements task support in SilverBullet.
2022-11-25 15:01:05 +00:00
## Task states
The tasks plug support the standard “done” and “not done” states via `[x]` and `[ ]` notation in the context of a list (this is fairly widely accepted [[Markdown]] syntax):
2022-11-25 15:01:05 +00:00
* [ ] This is a task (toggle me!)
2022-11-25 15:01:05 +00:00
However, custom states can also be used for extra flexibility:
* [TODO] This task is still to do
* [IN PROGRESS] In progress task
* [RESOLVED] A resolved task
* [-] Whatever this state means
* [/] Or this one
You can cycle through the states by clicking on the status or by running the {[Task: Cycle State]} command while on a task. There is also auto complete for all known custom task states in a space.
## Annotations
2023-08-29 19:17:29 +00:00
Tasks can also be annotated with [[Tags]]:
2022-11-25 15:01:05 +00:00
* [ ] This is a tagged task #my-tag
As well as [[Attributes]]:
* [ ] This is a task with attributes [taskAttribute: true]
## Deadlines
2022-11-25 15:01:05 +00:00
Tasks can specify deadlines:
* [ ] This is due 📅 2022-11-26
When the cursor is positioned inside of a due date, the {[Task: Postpone]} command can be used to postpone the task for a certain period.
2022-11-25 15:01:05 +00:00
## Querying
All meta data (`done` status, `state`, `tags`, `deadline` and custom attributes) is extracted and available via the `task` query source to [[Live Queries]]:
```query
task where page = "{{@page.name}}"
```
## Rendering
2023-11-15 13:56:34 +00:00
There is a [[!silverbullet.md/template/tasks/task]] template you can use to render tasks nicely rather than using the default table (as demonstrated above). When you use this template, you can even cycle through the states of the task by click on its state _inside_ the rendered query, and it will update the state of the _original_ task automatically (although not yet in reverse) — this works across pages.
Try it (by clicking on the checkbox inside of the query):
```query
task where page = "{{@page.name}}" and name = "Remote toggle me" render [[Library/Core/Query/Task]]
```
* [ ] Remote toggle me