添加索引数据

dataview 可以通过 文档的数据进行索引,文档的数据往往在文档的前面以yaml的形式给出,比如:

1
tags:1,2,3

当然也可以使用这种方式: From [author:: Edgar Allan Poe], written in (published:: 1845)

1
2
3
4
5
6
7
8
// 筛选器UI
dv.el("div", "按标签筛选: " +
dv.el("select", ["全部","标签1","标签2"]))

// 查询逻辑
const items = dv.current().file.content
.match(/^# (.+?)\n([\s\S]+?)(?=^# |$)/gm)
.map(...)

项目1

内容正文...

项目2

另一个内容...