Obsidian dataview 使用入门

server/2024/9/25 23:13:34/

Dataview有四种展示格式:list、table、task、calendar。 本文只介绍前面两种。

语法总结

通过#标签

```dataview 
LIST FROM #标签
```

通过"文件夹"

```dataview 
LIST FROM "文件夹名"  
```

通过[ [ 文件链接 ] ]

选择链接到一个文件,或者从一个文件获取所有链接,即,获取反向链接或者出链

```dataview 
LIST FROM[[文件链接]]
```

或着

```dataview 
list from outgoing([[文件链接]])
```

表格 table

```dataview 
table FROM "文件夹名"  
```

任务 task

```dataview 
task FROM "文件夹名"  
```

示例说明

元数据

所有笔记中都有隐含元数据,下面属性值都可以在Dataview查询中直接引用。

属性类型
file.name文件 标题字符串
file.path完整文件 路径字符串
file.link文件的 链接链接
file.size文件的 大小(以字节为单位)数字
file.ctime文件 创建 日期日期
file.mtime文件上次 修改 日期日期
file.day笔记标题中包含的 日期日期
file.tags笔记中所有 标签数组数组

1. 创建示例笔记

除了上面笔记自带的元数据属性,我们还可以手动添加元数据,有两种方式:1)添加文档属性;2)行内添加。

示例

  1. 新建两页笔记Movie X testMovie X test2
  2. 在笔记里复制粘贴下面内容,可以自己编辑修改:
--- 
genre: "action" 
reviewed: false 
---
# Movie X 
#movies **Thoughts**:: It was decent. 
**Rating**:: 6 [mood:: okay] | [length:: 2 hours]

1. 增加文档属性

手动增加文档属性
在这里插入图片描述
属性添加后如下:
在这里插入图片描述
勾选源码模式查看:文档内会显示源码
在这里插入图片描述

2. 行内元数据

  • 使用:: 添加

  • 直接使用时,一行只能添加一个元数据。
    ![[Dataview test-20240506112528452.webp|240]]

  • 在[ ]内使用,这种方法可以在同一行或者一段文字内添加多种属性数据。
    ![[Dataview test-20240506112559491.webp]]

Dataview 查询示例:

通过标签查询,以table格式

```dataview 
TABLE file.ctime, length, rating, reviewed,genre FROM #movies 
```

在这里插入图片描述
通过标签查询,以list格式

```dataview 
LIST FROM #movies
```

在这里插入图片描述

其他文件字段

Field NameData TypeDescription
file.nameTextThe file name as seen in Obsidians sidebar.
file.folderTextThe path of the folder this file belongs to.
file.pathTextThe full file path, including the files name.
file.extTextThe extension of the file type; generally md.
file.linkLinkA link to the file.
file.sizeNumberThe size (in bytes) of the file.
file.ctimeDate with TimeThe date that the file was created.
file.cdayDateThe date that the file was created.
file.mtimeDate with TimeThe date that the file was last modified.
file.mdayDateThe date that the file was last modified.
file.tagsListA list of all unique tags in the note. Subtags are broken down by each level, so #Tag/1/A will be stored in the list as [#Tag, #Tag/1, #Tag/1/A].
file.etagsListA list of all explicit tags in the note; unlike file.tags, does not break subtags down, i.e. [#Tag/1/A]
file.inlinksListA list of all incoming links to this file, meaning all files that contain a link to this file.
file.outlinksListA list of all outgoing links from this file, meaning all links the file contains.
file.aliasesListA list of all aliases for the note as defined via the YAML frontmatter.
file.tasksListA list of all tasks (I.e., | [ ] some task) in this file.
file.listsListA list of all list elements in the file (including tasks); these elements are effectively tasks and can be rendered in task views.
file.frontmatterListContains the raw values of all frontmatter in form of key | value text values; mainly useful for checking raw frontmatter values or for dynamically listing frontmatter keys.
file.dayDateOnly available if the file has a date inside its file name (of form yyyy-mm-dd or yyyymmdd), or has a Date field/inline field.
file.starredBooleanIf this file has been bookmarked via the Obsidian Core Plugin “Bookmarks”.

官方说明文档:

Dataview


http://www.ppmy.cn/server/36047.html

相关文章

3D模型实时变形算法

最近,在尝试渲染一些奇怪的形状后,我陷入了计算机图形学的困境。事实证明,对于我试图解决的具体问题,没有现有的选项完全适合我想要做的事情。几周后,我终于带着一些答案再次浮出水面,写了很多行代码&#…

IJCAI 2024:吉林大学、中国科学院计算技术研究所和自动化研究所等揭示数据增强在开放场景下的“两面性”

吉林大学人工智能学院研究员高一星、中国科学院计算技术研究所副研究员唐帆、中国科学院自动化研究所研究员董未名等在人工智能领域的CCF-A类顶级国际会议IJCAI上发表的工作,揭示并分析基于样本混合的数据增强方法在开放场景下存在的问题,提出了基于非对…

sqlalchemy 分表实现方案

1.需求及场景概述 现有系统中因历史数据量过大,产生了将历史数据进行按月存储的要求,系统和数据库交互使用的是sqlalchemy,假设系统的原来的历史记录表(record)如下: 为了将历史数据按月分表存储&#xff0…

实现拖拽功能的实战示例

以下是一个简单的用JavaScript实现拖拽功能的示例&#xff1a; HTML代码&#xff1a; <!DOCTYPE html> <html> <head><title>拖拽示例</title><style>#draggable {width: 100px;height: 100px;background-color: red;position: absolute…

Java全栈开发前端+后端(全栈工程师进阶之路)-环境搭建

在课程开始前我们要配置好我们的开发环境&#xff0c;这里我的电脑太乱了&#xff0c;我使用vm虚拟机进行搭建开发环境&#xff0c;如果有需要环境的或者安装包&#xff0c;可以私信我。 那我们开始 首先我们安装数据库 这里我们使用小皮面板 小皮面板(phpstudy) - 让天下没…

【docker】常用的Docker编排和调度平台

常用的Docker编排和调度平台 Kubernetes (K8s): Kubernetes是目前市场上最流行和功能最全面的容器编排和调度平台。它由Google开发并开源&#xff0c;现由CNCF&#xff08;云原生计算基金会&#xff09;维护。Kubernetes设计用于自动化容器部署、扩展和管理&#xff0c;支持跨…

ABAP开发(5)字符串操作

文章目录 1、CONCATENATE2、SPLIT3、SEARCH4、REPLACE 1、CONCATENATE 使用关键字CONCATENATE可以将多个字符串进行连接&#xff0c;也可以在连接的过程中添加分隔符。 2、SPLIT 3、SEARCH 4、REPLACE

实时音视频通信的主要矛盾及解决方法

实时音视频通信的主要矛盾及解决方法 实时音视频通信的主要矛盾及解决方法实时音视频通信的主要矛盾矛盾的解决方法增加带宽减少数据量适当增加延时提高网络质量快速准确地评估带宽 总结参考 实时音视频通信的主要矛盾及解决方法 实时音视频通信的主要矛盾 实时音视频通信的主…