Obsidian Tasks插件介绍

背景

按照之前对 DataView 插件的介绍,对于任务列表的使用其实就可以使用其中的 list 插件完成的,但是 DataView 插件只能完成列表的查询功能,而查询功能只能是任务列表中其中一个功能,因此就使用 DataVIew 插件是不够满足对任务列表的使用的,因此在 Obsidian 的插件库中还提供了另外一个专门针对任务列表的插件 —— Tasks

日常使用

场景一

使用 Calendar 插件记录每天需要完成的任务,而 Tasks 起到统计作用,负责记录的任务哪些已经做完,哪些还没有做完。

场景二

[!note]
如果使用 Obsidian Memos 插件和 Tasks 插件搭配使用,需要将 Memos 插件格式改为代办格式

使用 Obsidian Memos 插件作为记录需要完成任务,并且使用 TAG 来标注,方便后续 Tasks 插件查询的时候进行过滤

基础使用

创建任务

Tasks 插件提供一个窗口来创建或者编辑任务,在命令窗口搜索 Tasks: Create or edit task 命令就可以进入该窗口。

[!note]
也可以通过快捷键方法进入创建/编辑窗口,默认是 shift + command + B

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-voCq5hkl-1667641453772)(source/Pasted%20image%2020221105164215.png)]

对于 Tasks 窗口,最简单的使用方式就是输入任务名称就算是创建完任务,当然也可以按照提供的样式来对任务进行限定,比如加上优先级,循环,期限以及开始结束时间。

以下就是添加完所有选项之后的待办任务,🔼表示优先级,🔁表示循环,🛫表示开始时间,⏳表示结束时间,📅表示期限,这和 Tasks 窗口中出现的 Emoji 表情是一一对应的,还有一种 Emoji 表情就是✅,这表示完成时间。

- [ ] DEMO 🔼 🔁 every day 🛫 2022-11-13 ⏳ 2022-11-12 📅 2022-11-06
- [x] DEMO 🔼 🔁 every day 🛫 2022-11-13 ⏳ 2022-11-12 📅 2022-11-06 ✅ 2022-11-05

除了使用 Tasks 窗口来创建 Tasks 样式的待办任务,也可以通过正常创建待办任务的方法创建 Tasks 央视的待办任务,只需要带上对应的 Emoji 表情以及对应的时间就能被 Tasks 插件识别。

[!note]
在创建待办任务的过程中,Tasks 插件会提供 Auto-Suggestion 自动提示的弹窗更好的帮助用户使用该插件上的功能

过滤规则

在说明查询功能使用之前需要先介绍 Tasks 插件提供的过滤规则,方便在查询过程中进行过滤待办任务。常用的过滤规则就前面的 Done DateDue Date 以及 Tag 几种,剩下的都是文档中介绍

Done Date 完成时间
  • done
  • not done
  • no done date
  • has done date
  • done (before|after|on) <date>
  • done date is invalid
Due Date 期限时间
  • no due date
  • has due date
  • due (before|after|on) <date>
  • due date is invalid
Scheduled Date 结束时间
  • no scheduled date
  • has scheduled date
  • scheduled (before|after|on) <date>
  • scheduled date is invalid
Start Date 开始时间
  • no start date
  • has start date
  • starts (before|after|on) <date>
  • start date is invalid
Description 描述
  • description (includes|does not include) <string>
  • description (regex matches|regex does not match) /<JavaScript-style Regex>/
Priority 优先级
  • priority is (above|below)? (low|none|medium|high)
Recurrence 循环
  • is recurring
  • is not recurring
Tags 标签
  • tags (include|do not include) <tag>
  • tag (includes|does not include) <tag>
  • tags (regex matches|regex does not match) /<JavaScript-style Regex>/
  • tag (regex matches|regex does not match) /<JavaScript-style Regex>/
File Path 文件路径
  • path (includes|does not include) <path>
  • path (regex matches|regex does not match) /<JavaScript-style Regex>/
File Name 文件名称
  • filename (includes|does not include) <filename>
  • filename (regex matches|regex does not match) /<JavaScript-style Regex>/
Heading 开头
  • heading (includes|does not include) <string>
  • heading (regex matches|regex does not match) /<JavaScript-style Regex>/

查询任务

查询任务的功能和DataView很类似,也是一种类SQL的写法,其中和DataView插件和SQL最大的不同就是Tasks写法其实只是SQL中where关键词后的过滤部分,但是没有and关键词作为连接而是使用换行进行区分。

例子如下:

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-DURZ2qu7-1667641453774)(source/Pasted%20image%2020221105172244.png)]

从例子中可以看出,Tasks查询除了可以使用之前上面所介绍的过滤规则,也可以定义样式或者更准确的说是功能。下面简单介绍日常使用中比较多的功能,更为详细的可以查看官方文档。

Sort 排序
  • urgency (urgency)
  • status (done or todo)
  • priority (priority of the task; “low” is below “none”: priorities)
  • start (the date when the task starts)
  • scheduled (the date when the task is scheduled)
  • due (the date when the task is due)
  • done (the date when the task was done)
  • path (the path to the file that contains the task)
  • description (the description of the task)
  • tag (the description of the task)

例子:

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-BMAPwiR5-1667641453774)(source/Pasted%20image%2020221105173909.png)]

Hiding/Showing Elements 组件

以下都是可以选择展示或者隐藏的组件,而日常使用的话,使用edit button比较多,因为平时关于这类查询的文件都是预览界面,不需要进行修改编辑。

  • edit button
  • backlink
  • urgency
  • priority
  • start date
  • scheduled date
  • due date
  • done date
  • recurrence rule
  • task coun

参考资料

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值