介绍
# obsidian-tasks
使用看板、Dataview 仪表板和结构化任务笔记在 Obsidian 仓库中进行任务管理。
## 安装设置
运行安装脚本以在 Obsidian 仓库中初始化一个任务看板:
```bash python3 scripts/setup.py <vault-path> [--folder <name>] [--columns <col1,col2,...>] ```
- `vault-path`: Obsidian 仓库根目录的路径 - `--folder`: 要创建的子文件夹(默认:`Tasks`) - `--columns`: 看板列(默认:`Backlog,Todo,In Progress,Review,Done`)
这将创建: - `<folder>/Board.md` - 看板(需要 Kanban 社区插件) - `<folder>/Dashboard.md` - Dataview 仪表板(需要 Dataview 社区插件)
如果尚未安装,请告知用户安装 **Kanban** 和 **Dataview** 社区插件。
## 任务笔记格式
每个任务都是一个独立的 Markdown 文件,包含 YAML frontmatter:
```markdown --- status: todo priority: P1 category: revenue created: 2026-02-03 due: 2026-02-07 ---
# Task Title
Description and notes here.
## References - [[linked-document|Display Name]]
## Status - [x] Step completed - [ ] Step pending ```
### Frontmatter 字段
| 字段 | 值 | 必填 | |-------|--------|----------| | status | backlog, todo, in-progress, review, done | 是 | | priority | P1, P2, P3 | 是 | | category | 自由文本(revenue, content, research, setup, project) | 是 | | created | YYYY-MM-DD | 是 | | due | YYYY-MM-DD | 否 | | parked_until | YYYY-MM-DD | 否 |
### 看板上的优先级标签
在看板上使用 emoji 前缀来直观显示优先级: - 🔴 P1(紧急) - 🟡 P2(普通) - 🟢 P3(待办/搁置)
## 管理任务
### 创建任务
1. 在任务文件夹中创建一个包含 frontmatter 的 Markdown 文件 2. 在 Board.md 的适当列中添加一张卡片: ``` - [ ] [[Task Name]] 🔴 P1 @{2026-02-07} ```
### 移动任务
1. 更新任务笔记 frontmatter 中的 `status` 2. 将 Board.md 中的卡片行移动到目标列
### 完成任务
1. 在 frontmatter 中设置 `status: done` 2. 移动到 Done 列并勾选复选框: ``` - [x] [[Task Name]] ✅ 2026-02-03 ```
### 始终同时更新 Board.md 和任务笔记 frontmatter 以保持它们同步。
## 链接文档
使用 Obsidian `[[wikilinks]]` 将任务与支持文档关联起来:
```markdown ## References - [[2026-02-03-research-report|Research Report]] - [[meeting-notes-jan|Meeting Notes]] ```
将引用的文档存储在同级文件夹中(例如,`Tasks/` 旁边的 `Research/`)。
## 仪表板查询
安装设置脚本会创建一个 Dataview 仪表板。核心查询如下:
**按优先级显示的任务:** ```dataview TABLE status, category, due FROM "<tasks-folder>" WHERE priority = "P1" AND status != "done" SORT due ASC ```
**过期的任务:** ```dataview TABLE priority, category FROM "<tasks-folder>" WHERE due AND due < date(today) AND status != "done" SORT due ASC ```
**最近完成的任务:** ```dataview TABLE category FROM "<tasks-folder>" WHERE status = "done" SORT file.mtime DESC LIMIT 10 ```