Obsidian dataview 使用入门

2024-05-07 11:28

本文主要是介绍Obsidian dataview 使用入门,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

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

这篇关于Obsidian dataview 使用入门的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/967221

相关文章

Spring Security 从入门到进阶系列教程

Spring Security 入门系列 《保护 Web 应用的安全》 《Spring-Security-入门(一):登录与退出》 《Spring-Security-入门(二):基于数据库验证》 《Spring-Security-入门(三):密码加密》 《Spring-Security-入门(四):自定义-Filter》 《Spring-Security-入门(五):在 Sprin

中文分词jieba库的使用与实景应用(一)

知识星球:https://articles.zsxq.com/id_fxvgc803qmr2.html 目录 一.定义: 精确模式(默认模式): 全模式: 搜索引擎模式: paddle 模式(基于深度学习的分词模式): 二 自定义词典 三.文本解析   调整词出现的频率 四. 关键词提取 A. 基于TF-IDF算法的关键词提取 B. 基于TextRank算法的关键词提取

使用SecondaryNameNode恢复NameNode的数据

1)需求: NameNode进程挂了并且存储的数据也丢失了,如何恢复NameNode 此种方式恢复的数据可能存在小部分数据的丢失。 2)故障模拟 (1)kill -9 NameNode进程 [lytfly@hadoop102 current]$ kill -9 19886 (2)删除NameNode存储的数据(/opt/module/hadoop-3.1.4/data/tmp/dfs/na

Hadoop数据压缩使用介绍

一、压缩原则 (1)运算密集型的Job,少用压缩 (2)IO密集型的Job,多用压缩 二、压缩算法比较 三、压缩位置选择 四、压缩参数配置 1)为了支持多种压缩/解压缩算法,Hadoop引入了编码/解码器 2)要在Hadoop中启用压缩,可以配置如下参数

Makefile简明使用教程

文章目录 规则makefile文件的基本语法:加在命令前的特殊符号:.PHONY伪目标: Makefilev1 直观写法v2 加上中间过程v3 伪目标v4 变量 make 选项-f-n-C Make 是一种流行的构建工具,常用于将源代码转换成可执行文件或者其他形式的输出文件(如库文件、文档等)。Make 可以自动化地执行编译、链接等一系列操作。 规则 makefile文件

使用opencv优化图片(画面变清晰)

文章目录 需求影响照片清晰度的因素 实现降噪测试代码 锐化空间锐化Unsharp Masking频率域锐化对比测试 对比度增强常用算法对比测试 需求 对图像进行优化,使其看起来更清晰,同时保持尺寸不变,通常涉及到图像处理技术如锐化、降噪、对比度增强等 影响照片清晰度的因素 影响照片清晰度的因素有很多,主要可以从以下几个方面来分析 1. 拍摄设备 相机传感器:相机传

pdfmake生成pdf的使用

实际项目中有时会有根据填写的表单数据或者其他格式的数据,将数据自动填充到pdf文件中根据固定模板生成pdf文件的需求 文章目录 利用pdfmake生成pdf文件1.下载安装pdfmake第三方包2.封装生成pdf文件的共用配置3.生成pdf文件的文件模板内容4.调用方法生成pdf 利用pdfmake生成pdf文件 1.下载安装pdfmake第三方包 npm i pdfma

零基础学习Redis(10) -- zset类型命令使用

zset是有序集合,内部除了存储元素外,还会存储一个score,存储在zset中的元素会按照score的大小升序排列,不同元素的score可以重复,score相同的元素会按照元素的字典序排列。 1. zset常用命令 1.1 zadd  zadd key [NX | XX] [GT | LT]   [CH] [INCR] score member [score member ...]

数论入门整理(updating)

一、gcd lcm 基础中的基础,一般用来处理计算第一步什么的,分数化简之类。 LL gcd(LL a, LL b) { return b ? gcd(b, a % b) : a; } <pre name="code" class="cpp">LL lcm(LL a, LL b){LL c = gcd(a, b);return a / c * b;} 例题:

git使用的说明总结

Git使用说明 下载安装(下载地址) macOS: Git - Downloading macOS Windows: Git - Downloading Windows Linux/Unix: Git (git-scm.com) 创建新仓库 本地创建新仓库:创建新文件夹,进入文件夹目录,执行指令 git init ,用以创建新的git 克隆仓库 执行指令用以创建一个本地仓库的